summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-08-27 14:26:49 -0500
committerLuke Kanies <luke@madstop.com>2007-08-27 14:26:49 -0500
commit1de5ae0da0d336f1b96ceaac5aca1dfed4169460 (patch)
tree9a302b3e786ba320c6d668bc93387044027e6092 /bin
parent11081ce8864dca2bc92d8c9f825c3fe7f96333f4 (diff)
downloadpuppet-1de5ae0da0d336f1b96ceaac5aca1dfed4169460.tar.gz
puppet-1de5ae0da0d336f1b96ceaac5aca1dfed4169460.tar.xz
puppet-1de5ae0da0d336f1b96ceaac5aca1dfed4169460.zip
Adding support for providing a diff when files are being changed. Currently uses a local diff binary, but could easily be changed to use the ruby diff/lcs library. Modified puppet and puppetd to automatically show file diffs when in noop mode, but can otherwise be enabled using --show_diff. This only works when running interactively, because the diffs are printed on stdout.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/puppet5
-rwxr-xr-xbin/puppetd6
2 files changed, 11 insertions, 0 deletions
diff --git a/bin/puppet b/bin/puppet
index 241bac785..b158226ba 100755
--- a/bin/puppet
+++ b/bin/puppet
@@ -134,6 +134,11 @@ end
Puppet.parse_config
+# If noop is set, then also enable diffs
+if Puppet[:noop]
+ Puppet[:show_diff] = true
+end
+
unless logset
Puppet::Util::Log.newdestination(:console)
end
diff --git a/bin/puppetd b/bin/puppetd
index 848a05b20..a03ed8f10 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -219,6 +219,7 @@ begin
Puppet.config.handlearg("--ignorecache")
Puppet.config.handlearg("--no-usecacheonfailure")
Puppet.config.handlearg("--no-splay")
+ Puppet.config.handlearg("--show_diff")
options[:onetime] = true
options[:waitforcert] = 0
unless Puppet::Util::Log.level == :debug
@@ -278,6 +279,11 @@ Puppet.parse_config
Puppet.genconfig
Puppet.genmanifest
+# If noop is set, then also enable diffs
+if Puppet[:noop]
+ Puppet[:show_diff] = true
+end
+
# Default to daemonizing, but if verbose or debug is specified,
# default to staying in the foreground.
unless options.include?(:daemonize)