summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-28 16:34:07 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-28 16:34:07 +0000
commitfee5116c3ac544d48d3ba5d6b434ce953d6330b0 (patch)
treee7ad250d987b68fd06c2269e197825173136e537 /lib/puppet
parent244a11d36f70ea38a85de709dc7cfcb80b610f7e (diff)
downloadpuppet-fee5116c3ac544d48d3ba5d6b434ce953d6330b0.tar.gz
puppet-fee5116c3ac544d48d3ba5d6b434ce953d6330b0.tar.xz
puppet-fee5116c3ac544d48d3ba5d6b434ce953d6330b0.zip
Fixing reported problem of crons rewriting every time when the environment is set
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1701 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/cron.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb
index ae12f4adf..8f8e9cae6 100755
--- a/lib/puppet/type/cron.rb
+++ b/lib/puppet/type/cron.rb
@@ -252,7 +252,11 @@ module Puppet
unmanaged environment setting is associated with a given cron
job. If you already have cron jobs with environment settings,
then Puppet will keep those settings in the same place in the file,
- but will not associate them with a specific job."
+ but will not associate them with a specific job.
+
+ Settings should be specified exactly as they should appear in
+ the crontab, e.g., 'PATH=/bin:/usr/bin:/usr/sbin'. Multiple
+ settings should be specified as an array."
validate do |value|
unless value =~ /^\s*(\w+)\s*=\s*(.+)\s*$/
@@ -265,7 +269,7 @@ module Puppet
if @is.is_a? Array
return @is.sort == @should.sort
else
- return @is == @should[0]
+ return @is == @should
end
end
@@ -573,7 +577,9 @@ module Puppet
end
unless envs.empty?
- hash[:environment] = envs
+ # We have to dup here so that we don't remove the settings
+ # in @is on the object.
+ hash[:environment] = envs.dup
end
hash[:user] = user