Puppet: System Administration Automated

Support

Ticket #1073 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

--show_diff is not implied by --noop

Reported by: porridge Assigned to: luke
Priority: normal Milestone:
Component: executables Version: 0.24.1
Severity: normal Keywords: noop show_diff puppet
Cc: Triage Stage: Ready for checkin
Attached Patches: Code Complexity: Trivial

Description

The following code inside bin/puppet does not work:

# If noop is set, then also enable diffs
if Puppet[:noop]
    Puppet[:show_diff] = true
end

or more correctly, it does, but unless --show_diff is specified explicitly, it gets reset to false just a few lines later, during :

    Puppet.settings.parse(Puppet[:config])

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

$ 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
[...]

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.

Change History

02/21/08 01:32:31 changed by jamtur01

  • owner changed from community to luke.
  • complexity changed from Unknown to Trivial.
  • stage changed from Unreviewed to Ready for checkin.

Fixed in commit [ 39a6756f4feedceadab1d257eab460867935b3d3] in branch 0.24.x

02/21/08 08:35:40 changed by jamtur01

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in commit [39a6756f4feedceadab1d257eab460867935b3d3]