diff options
author | Luke Kanies <luke@madstop.com> | 2009-03-22 22:00:41 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-03-24 08:15:33 +1100 |
commit | aa00bdedefcf4dce9c55968e33123a73b78fb6d6 (patch) | |
tree | 9ba8aee18d1aec93124c36c8d5ee9745da11db2b /lib | |
parent | 39deaf373c46c20d14a04391ad4b7c70ad43e266 (diff) | |
download | puppet-aa00bdedefcf4dce9c55968e33123a73b78fb6d6.tar.gz puppet-aa00bdedefcf4dce9c55968e33123a73b78fb6d6.tar.xz puppet-aa00bdedefcf4dce9c55968e33123a73b78fb6d6.zip |
Fixing #1631 - adding /sbin and /usr/sbin to PATH
This is a trivial fix but seems to crop up more often
than it should.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/defaults.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index e1b6dc423..e36dd7068 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -95,8 +95,17 @@ module Puppet :path => {:default => "none", :desc => "The shell search path. Defaults to whatever is inherited from the parent process.", + :call_on_define => true, # Call our hook with the default value, so we always get the libdir set. :hook => proc do |value| ENV["PATH"] = value unless value == "none" + + paths = ENV["PATH"].split(File::PATH_SEPARATOR) + %w{/usr/sbin /sbin}.each do |path| + unless paths.include?(path) + ENV["PATH"] += File::PATH_SEPARATOR + path + end + end + value end }, :libdir => {:default => "$vardir/lib", |