From fa16a92ff96d37d6b0d443536218d9d46d56eadd Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 5 Sep 2006 22:35:53 +0000 Subject: Fixing small bug in cron where removed fields are not deleted from the file git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1565 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/filetype.rb | 6 +++++- lib/puppet/type/cron.rb | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/puppet/filetype.rb b/lib/puppet/filetype.rb index a5dc6a115..03bf70838 100755 --- a/lib/puppet/filetype.rb +++ b/lib/puppet/filetype.rb @@ -153,7 +153,11 @@ module Puppet # Remove a specific @path's cron tab. def remove - %x{#{cmdbase()} -r 2>/dev/null} + if Facter.value("operatingsystem") == "FreeBSD" + %x{/bin/echo yes | #{cmdbase()} -r 2>/dev/null} + else + %x{#{cmdbase()} -r 2>/dev/null} + end end # Overwrite a specific @path's cron tab; must be passed the @path name diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb index 03ac24d29..cabe52a40 100755 --- a/lib/puppet/type/cron.rb +++ b/lib/puppet/type/cron.rb @@ -782,7 +782,8 @@ module Puppet if @states.include?(name) ret = @states[name].should_to_s - if ret == :absent or ret.nil? + #if ret == :absent or ret.nil? + if ret.nil? ret = @states[name].is_to_s end -- cgit