Skip to content

Commit

Permalink
Convert hash keys to strings #293
Browse files Browse the repository at this point in the history
Rails automatically converts keys to symbols, but this is not
standard behavior of the YAML parser, so we had a mismatch
here.
  • Loading branch information
oneiros committed Feb 16, 2024
1 parent 709f419 commit d39f63f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/hiera_data/hierarchy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def determine_backend
value = raw_hash[lookup_function]
backends = BACKENDS
custom_mappings = Rails.configuration.hdm[:custom_lookup_function_mapping]
backends = backends.deep_merge({ "lookup_key" => custom_mappings }) if custom_mappings.present?
backends = backends.deep_merge({ "lookup_key" => custom_mappings.stringify_keys }) if custom_mappings.present?
backends.fetch(key).fetch(value).to_sym
rescue KeyError
raise Hdm::Error, "unknown backend #{value}"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/files/puppet/environments/eyaml/hiera.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 5
defaults:
datadir: data
lookup_key: eyaml_lookup_key
lookup_key: custom_eyaml_function
options:
pkcs7_private_key: keys/private_key.pkcs7.pem
pkcs7_public_key: keys/public_key.pkcs7.pem
Expand Down

0 comments on commit d39f63f

Please sign in to comment.