diff --git a/app/models/hiera_data/hierarchy.rb b/app/models/hiera_data/hierarchy.rb index d532dc20..f67d3c48 100644 --- a/app/models/hiera_data/hierarchy.rb +++ b/app/models/hiera_data/hierarchy.rb @@ -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}" diff --git a/test/models/hiera_data/hierarchy_test.rb b/test/models/hiera_data/hierarchy_test.rb index 84ce0cd6..253c063f 100644 --- a/test/models/hiera_data/hierarchy_test.rb +++ b/test/models/hiera_data/hierarchy_test.rb @@ -234,7 +234,7 @@ class HierarchyForCustomBackend < ActiveSupport::TestCase test "custom lookup function mapped to eyaml" do Rails.configuration.hdm[:custom_lookup_function_mapping] = { - "custom_eyaml_function" => "eyaml" + custom_eyaml_function: "eyaml" } hierarchy = HieraData::Hierarchy.new(raw_hash:, base_path: ".") assert_equal :eyaml, hierarchy.backend