Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Improvement of Nested Fact Handling in facts_hash #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lcharreau
Copy link

In the facts_hash method, when encountering multiple facts with nested elements sharing the same base name (e.g., multiple facts related to networking), the current logic concatenated the keys to make them unique (e.g., "networking_hostname_networking_fqdn" instead of "networking_hostname" and "networking_fqdn"). This behaviour was incorrect as it treated them as a single fact instead of separate ones.

Improvements to fact queries:

Enhancements to nested keys processing:

  • lib/puppetdb/parser_helper.rb: Updated the facts_hash method to group nested keys individually, create unique names, and return nested results as an array of hashes to be added individually. This change ensures that nested results are handled properly and avoids redundant assignments.

Louis Charreau added 2 commits November 17, 2024 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant