Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom function mapping not working #293

Closed
tuxmea opened this issue Feb 8, 2024 · 1 comment · Fixed by #302
Closed

Custom function mapping not working #293

tuxmea opened this issue Feb 8, 2024 · 1 comment · Fixed by #302
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@tuxmea
Copy link
Member

tuxmea commented Feb 8, 2024

According to documentation one should set a mapping between the individual function and the used data backend:

  1. Hiera.yaml
---
version: 5
defaults:
  datadir: "%{facts.external_facts.datadir}"
  lookup_key: custom_eyaml_function
  #data_hash: yaml_data
hierarchy:
  - name: "Per-node data (yaml version)"
    path: "nodes/%{::trusted.certname}.yaml"
  - name: "Other YAML hierarchy levels"
    paths:
      - "common.yaml"
  1. HDM.yml
---
development:
  read_only: false
  allow_encryption: true
  puppet_db:
    server: "http://localhost:8080"
  config_dir: '/etc/puppetlabs/code'
  custom_lookup_function_mapping:
    custom_eyaml_function: eyaml
  1. Result from HDM:
HDM Error
unknown backend custom_eyaml_function

Content of backends variable:

{"data_hash"=>{"json_data"=>:json, "yaml_data"=>:yaml}, "lookup_key"=>{"eyaml_lookup_key"=>:eyaml, :custom_eyaml_function=>:eyaml}}
@tuxmea tuxmea added bug Something isn't working documentation Improvements or additions to documentation labels Feb 8, 2024
@oneiros
Copy link
Collaborator

oneiros commented Feb 15, 2024

Sorry, but I cannot reproduce this. Works for me 🤷‍♂️

oneiros added a commit that referenced this issue Feb 16, 2024
Rails automatically converts keys to symbols, but this is not
standard behavior of the YAML parser, so we had a mismatch
here.
oneiros added a commit that referenced this issue Feb 16, 2024
I wanted to revert my temporary changes to test data and
accidentally reverted the adjusted test for the previous
commit. This commit resolves that mixup.
tuxmea added a commit that referenced this issue Feb 20, 2024
* Convert hash keys to strings #293

Rails automatically converts keys to symbols, but this is not
standard behavior of the YAML parser, so we had a mismatch
here.

* Fix mixup #293

I wanted to revert my temporary changes to test data and
accidentally reverted the adjusted test for the previous
commit. This commit resolves that mixup.

---------

Co-authored-by: Martin Alfke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants