summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider/cron/crontab.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-06-18 21:56:11 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-06-18 21:56:11 +0000
commit01420acae6d02a54dcc1f1a823fac2b73e8353dc (patch)
treefd40e59673befbb6f47e1c0f3f03e698b86a5963 /lib/puppet/provider/cron/crontab.rb
parentfa39488560cac2d71461931ab4174387234137ea (diff)
downloadpuppet-01420acae6d02a54dcc1f1a823fac2b73e8353dc.tar.gz
puppet-01420acae6d02a54dcc1f1a823fac2b73e8353dc.tar.xz
puppet-01420acae6d02a54dcc1f1a823fac2b73e8353dc.zip
Adding tracing to prefetch failures, and Fixing the environment support in the cron type (#669).
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2621 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/provider/cron/crontab.rb')
-rwxr-xr-xlib/puppet/provider/cron/crontab.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb
index 23fa9201c..7599b1bdf 100755
--- a/lib/puppet/provider/cron/crontab.rb
+++ b/lib/puppet/provider/cron/crontab.rb
@@ -62,7 +62,7 @@ Puppet::Type.type(:cron).provide(:crontab,
if details[:name]
str = "# Puppet Name: %s\n" % details[:name]
end
- if details[:environment] and details[:environment] != :absent
+ if details[:environment] and details[:environment] != :absent and details[:environment] != [:absent]
details[:environment].each do |env|
str += env + "\n"
end
@@ -84,10 +84,9 @@ Puppet::Type.type(:cron).provide(:crontab,
end
# See if we can match the hash against an existing cron job.
- def self.match(hash)
- resource_type.find_all { |obj|
- obj.value(:user) == hash[:user] and obj.value(:command) == hash[:command]
- }.each do |obj|
+ def self.match(hash, resources)
+ resources.each do |name, obj|
+ p hash
# we now have a cron job whose command exactly matches
# let's see if the other fields match
@@ -152,10 +151,7 @@ Puppet::Type.type(:cron).provide(:crontab,
record[:name] = name
name = nil
end
- unless envs.empty?
- record[:environment] = envs
- envs = []
- end
+ record[:environment] = envs
end
}.reject { |record| record[:skip] }
end