Jira (PUP-10850) Puppet facts show doesn't have an option to opt out of legacy facts

12 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Jan 15, 2021, 6:00:04 PM1/15/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-10850
Puppet facts show doesn't have an option to opt out of legacy facts
Change By: Josh Cooper
Summary: Puppet facts show doesn't have an option to opt out option for of legacy facts
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Oana Tanasoiu (Jira)

unread,
Jan 18, 2021, 2:30:03 AM1/18/21
to puppe...@googlegroups.com
Oana Tanasoiu updated an issue
Change By: Oana Tanasoiu
Release Notes Summary: By default, 'puppet facts show' application displays all facts, including legacy facts. A new option,
Description of the fix: Fix the
-- no show -legacy , was added to disable option and don't display legacy facts by default (only when querying for all facts. The the --show-legacy facts option remains, but is ignored, as that is the default behavior provided) .

Josh Cooper (Jira)

unread,
Jan 19, 2021, 6:09:04 PM1/19/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10850
 
Re: Puppet facts show doesn't have an option to opt out of legacy facts

Hi Oana Tanasoiu this doesn't seem to be working as expected. Using puppet 7.3.0, the --no-legacy option is rejected:

$ git rev-parse HEAD
3d4df020ea74ca5695e03229fa1279adf0dda3fa
$ bx puppet facts show --no-legacy | jq .
Error: Could not parse application options: invalid option: --no-legacy

It looks like https://github.com/puppetlabs/puppet/pull/8475 was merged first in https://github.com/puppetlabs/puppet/commit/49918bd5cc17a93bba14d2b9a94b44848fdb7b4d which added --no-legacy, but it accidentally removed --show-legacy.

The change to --show-legacy broke other applications that call puppet facts show. So https://github.com/puppetlabs/puppet/pull/8478 restored --show-legacy and that was merged in https://github.com/puppetlabs/puppet/commit/a600c40f32cfbcf77d58ae19f62ff5710a7fe940.

Using that version --show-legacy and --no-legacy are both accepted, but the latter doesn't omit legacy facts:

$ bx puppet facts show | jq .virtual
"physical"
$ bx puppet facts show --no-legacy | jq .virtual
"physical"

Then https://github.com/puppetlabs/puppet/pull/8482 was merged, which removed the ability to specify --no-legacy. So aren't we back where we started and this ticket isn't fixed?

Oana Tanasoiu (Jira)

unread,
Jan 20, 2021, 2:36:04 AM1/20/21
to puppe...@googlegroups.com

Hi Josh Cooper,

 

We decided that is better to restore the behaviour as it was initially made. By default puppet facts show doesn't display legacy facts and the application has an opt-in mechanism for puppet facts through --show-legacy flag.

Kenyon Ralph (Jira)

unread,
Jan 20, 2021, 3:08:04 PM1/20/21
to puppe...@googlegroups.com
Kenyon Ralph commented on Bug PUP-10850

The release notes should be fixed then.

"By default, puppet facts show displays all facts, including legacy facts. This release adds a --no-legacy option to disable legacy facts when querying all facts. PUP-10850" – https://puppet.com/docs/puppet/7.3/release_notes_puppet.html#release_notes_puppet

Josh Cooper (Jira)

unread,
Jan 21, 2021, 6:15:04 PM1/21/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10850

Ah I think part of my confusion is that virtual seems to always be emitted when showing legacy facts or not. Is that expected?

$ bx facter | grep '^virtual'
virtual => physical

If I use a different legacy fact, then it seems to work as expected:

$ bx puppet facts show | jq .swapfree
null
$ bx puppet facts show --show-legacy | jq .swapfree
"1.09 GiB"

Josh Cooper (Jira)

unread,
Jan 21, 2021, 6:16:03 PM1/21/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
*Puppet Version: 7.0.1*
*Puppet Server Version: -* 
*OS Name/Version: All*

By default
{
code:java noformat }
puppet facts show{
code noformat }
displays legacy facts, there is an option (--show-legacy) that has no effect. There isn't any way to indicate puppet to not retrieve legacy facts.

*Desired Behavior:*

 
Add option By default {{puppet facts show}} does not display legacy facts, but they may be displayed using {{puppet facts show -- no show -legacy to disable legacy facts. }}

 
Reply all
Reply to author
Forward
0 new messages