diff options
| author | Luke Kanies <luke@madstop.com> | 2008-02-07 12:57:57 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-02-07 12:57:57 -0600 |
| commit | f19e106b5ee0eab0ca0de2f441073b37540f3e8f (patch) | |
| tree | 7f815b00a67cb120ffeb462c2a1bcc1797b3702b /lib | |
| parent | b3f67ec4017940a7eb47f3a044fd77c8d32a74cf (diff) | |
| parent | 8f0d87d498ca12417a7d20b81ba46465658fa210 (diff) | |
| download | puppet-f19e106b5ee0eab0ca0de2f441073b37540f3e8f.tar.gz puppet-f19e106b5ee0eab0ca0de2f441073b37540f3e8f.tar.xz puppet-f19e106b5ee0eab0ca0de2f441073b37540f3e8f.zip | |
Merge commit 'plathrop/fix-1007' into 0.24.x
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/type/exec.rb | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index 5bb3158c4..7d3b1abe1 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -229,6 +229,15 @@ module Puppet end newparam(:env) do + desc "This parameter is deprecated. Use 'environment' instead." + + munge do |value| + warning "'env' is deprecated on exec; use 'environment' instead." + resource[:environment] = value + end + end + + newparam(:environment) do desc "Any additional environment variables you want to set for a command. Note that if you use this to set PATH, it will override the ``path`` attribute. Multiple environment variables should be @@ -554,32 +563,32 @@ module Puppet begin # Do our chdir Dir.chdir(dir) do - env = {} + environment = {} if self[:path] - env[:PATH] = self[:path].join(":") + environment[:PATH] = self[:path].join(":") end - if envlist = self[:env] + if envlist = self[:environment] envlist = [envlist] unless envlist.is_a? Array envlist.each do |setting| if setting =~ /^(\w+)=((.|\n)+)$/ name = $1 value = $2 - if env.include? name + if environment.include? name warning( "Overriding environment setting '%s' with '%s'" % [name, value] ) end - env[name] = value + environment[name] = value else - warning "Cannot understand env setting %s" % setting.inspect + warning "Cannot understand environment setting %s" % setting.inspect end end end - withenv env do + withenv environment do Timeout::timeout(self[:timeout]) do output, status = Puppet::Util::SUIDManager.run_and_capture( [command], self[:user], self[:group] |
