Skip to content

Conversation

@binford2k
Copy link
Contributor

Some years ago a bug was filed
noting that puppet facts show appended all local facts when called with
one or more specific facts. This was resolved by simply not including
local facts for this specific subcommand.

This had the unfortunate side effect that something like puppet facts show clientcert no longer displayed anything. (note: you could still
run puppet config print certname but that takes a LOT of institutional
knowledge to know that those are the same thing.) Worse, when we added
the implementation local fact, it also didn't display.

This PR just returns to including the local facts into puppet fact show
output, but only the ones requested or when requesting all facts.

Fixes #220

Some years ago [a bug was filed](https://puppet.atlassian.net/browse/PUP-10717)
noting that `puppet facts show` appended all local facts when called with
one or more specific facts. This was resolved by simply not including
local facts for this specific subcommand.

This had the unfortunate side effect that something like `puppet facts
show clientcert` no longer displayed anything. (note: you could still
run `puppet config print certname` but that takes a LOT of institutional
knowledge to know that those are the same thing.) Worse, when we added
the `implementation` local fact, it also didn't display.

This PR just returns to including the local facts into `puppet fact show`
output, but only the ones requested or when requesting all facts.

Fixes OpenVoxProject#220
Comment on lines +30 to +31
def add_local_facts(query = [])
query = Array(query) # some use cases result in a nil being passed in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very slightly less boilerplate, but totally fine as-is too.

Suggested change
def add_local_facts(query = [])
query = Array(query) # some use cases result in a nil being passed in
def add_local_facts(query)
query ||= [] # some use cases result in a nil being passed in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: implementation is just a local fact

2 participants