Jira (PUP-11693) puppet apply --show-diff does nothing

7 views
Skip to first unread message

Daniel Parks (Jira)

unread,
Dec 15, 2022, 8:27:02 AM12/15/22
to puppe...@googlegroups.com
Daniel Parks created an issue
 
Puppet / Bug PUP-11693
puppet apply --show-diff does nothing
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2022/12/15 5:26 AM
Priority: Normal Normal
Reporter: Daniel Parks

Puppet Version: 7.21.0
Puppet Server Version: N/A
OS Name/Version: Ubuntu 22.04.1 Jammy

puppet apply (and presumably agent) accepts a -show-diff parameter without failing, but it doesn’t do anything. (The correct name for the parameter is -show_diff; note the underscore.)

This is mostly a problem because -show-diff is a natural guess based on the configuration reference. I’m not sure it’s actual name is documented outside of the help for the -test option.

Desired Behavior: either fail with “invalid option” or succeed as if --show_diff was specified.
Actual Behavior: ignores the option

❯ rm -f /tmp/foo ; touch /tmp/foo
❯ puppet apply --show_diff -e 'file { "/tmp/foo": content => "${facts[system_uptime][seconds]}\n" }'
Notice: Compiled catalog for vm3.oxidized.org in environment production in 0.01 seconds
Notice: /Stage[main]/Main/File[/tmp/foo]/content: 
--- /tmp/foo	2022-12-15 05:22:48.650776253 -0800
+++ /tmp/puppet-file20221215-13413-13tokve	2022-12-15 05:22:52.354791664 -0800
@@ -0,0 +1 @@
+77133
 
Notice: /Stage[main]/Main/File[/tmp/foo]/content: content changed '{sha256}e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' to '{sha256}9bd523e3860777cd1c2d38207b95a7bc0bd8ed1d47afc839da1378ce71ad28f3'
Notice: Applied catalog in 0.02 seconds
❯ sleep 1 ; puppet apply --show-diff -e 'file { "/tmp/foo": content => "${facts[system_uptime][seconds]}\n" }'
Notice: Compiled catalog for vm3.oxidized.org in environment production in 0.01 seconds
Notice: /Stage[main]/Main/File[/tmp/foo]/content: content changed '{sha256}9bd523e3860777cd1c2d38207b95a7bc0bd8ed1d47afc839da1378ce71ad28f3' to '{sha256}3b9cd754c5b3f7219943c3ebdf2b51b972980cfc0d478e645784ae2b78699314'
Notice: Applied catalog in 0.01 seconds
❯ puppet apply --invalid
Error: Could not parse application options: invalid option: --invalid

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Daniel Parks (Jira)

unread,
Dec 15, 2022, 8:28:02 AM12/15/22
to puppe...@googlegroups.com
Daniel Parks updated an issue
Change By: Daniel Parks
*Puppet Version:* 7.21.0
*Puppet Server Version:* N/A
*OS Name/Version:* Ubuntu 22.04.1 Jammy

{{puppet apply}} (and presumably {{
{} agent { }} } ) accepts a {{ \ --show-diff}} parameter without failing, but it doesn’t do anything. (The correct name for the parameter is {{ {} \ --show_diff { }} } ; note the underscore.)

This is mostly a problem because {{
\ --show-diff}} is a natural guess based on the configuration reference. I’m not sure it’s actual name is documented outside of the help for the {{ \ --test}} option.

*Desired Behavior:* either fail with “invalid option” or succeed as if {{
\ --show_diff}} was specified.
*Actual Behavior:* ignores the option
{code}❯ rm -f /tmp/foo ; touch /tmp/foo

❯ puppet apply --show_diff -e 'file { "/tmp/foo": content => "${facts[system_uptime][seconds]}\n" }'
Notice: Compiled catalog for vm3.oxidized.org in environment production in 0.01 seconds
Notice: /Stage[main]/Main/File[/tmp/foo]/content:
--- /tmp/foo 2022-12-15 05:22:48.650776253 -0800
+++ /tmp/puppet-file20221215-13413-13tokve 2022-12-15 05:22:52.354791664 -0800
@@ -0,0 +1 @@
+77133

Notice: /Stage[main]/Main/File[/tmp/foo]/content: content changed '{sha256}e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' to '{sha256}9bd523e3860777cd1c2d38207b95a7bc0bd8ed1d47afc839da1378ce71ad28f3'
Notice: Applied catalog in 0.02 seconds
❯ sleep 1 ; puppet apply --show-diff -e 'file { "/tmp/foo": content => "${facts[system_uptime][seconds]}\n" }'
Notice: Compiled catalog for vm3.oxidized.org in environment production in 0.01 seconds
Notice: /Stage[main]/Main/File[/tmp/foo]/content: content changed '{sha256}9bd523e3860777cd1c2d38207b95a7bc0bd8ed1d47afc839da1378ce71ad28f3' to '{sha256}3b9cd754c5b3f7219943c3ebdf2b51b972980cfc0d478e645784ae2b78699314'
Notice: Applied catalog in 0.01 seconds
❯ puppet apply --invalid
Error: Could not parse application options: invalid option: --invalid
{code}

Josh Cooper (Jira)

unread,
Dec 15, 2022, 6:39:03 PM12/15/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11693
 
Re: puppet apply --show-diff does nothing

I think this is variation of PUP-4429, though in this case it's underscore vs dash.

Morgan Rhodes (Jira)

unread,
Jan 3, 2023, 4:34:03 PM1/3/23
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
 
Change By: Morgan Rhodes
Epic Link: PUP-11660

Morgan Rhodes (Jira)

unread,
Jan 3, 2023, 4:34:03 PM1/3/23
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages