Issue #1073 has been updated by Raphaƫl Pinson.

Description updated

This seems broken again in 2.7.19.

----------------------------------------
Bug #1073: --show_diff is not implied by --noop
https://projects.puppetlabs.com/issues/1073#change-97011

* Author: Marcin Owsiany
* Status: Closed
* Priority: Normal
* Assignee: Luke Kanies
* Category: executables
* Target version: 
* Affected Puppet version: 0.25.4
* Keywords: 
* Branch: 
----------------------------------------
The following code inside bin/puppet does not work:
<pre>
# If noop is set, then also enable diffs
if Puppet[:noop]
    Puppet[:show_diff] = true
end
</pre>

or more correctly, it does, but unless --show_diff is specified explicitly, it 
gets reset to false just a few lines later, during :
<pre>
    Puppet.settings.parse(Puppet[:config])
</pre>

I verified this by inserting some debugging statements in a few points along 
the code path.

<pre>
$ puppet --noop --diff_args -u manifests/site.pp
notice: SHOW DIFF is true after setting the option
notice: SHOW DIFF is true before settings.parse
notice: SHOW DIFF is false after settins.parse
[...]
$ puppet --noop --show_diff --diff_args -u manifests/site.pp
notice: SHOW DIFF is true after setting the option
notice: SHOW DIFF is true before settings.parse
notice: SHOW DIFF is true after settins.parse
[...]
</pre>

Moving the bit of code mentioned at the begining of the ticket to a point after 
Puppet.settings.parse is called fixes the issue for me.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to