From 0c6f50cbc1409cb9e31f4f512a7ff27d4b4c5167 Mon Sep 17 00:00:00 2001 From: Nick Lewis Date: Tue, 12 Apr 2011 15:23:26 -0700 Subject: (#775) Don't require command when removing cron entries Previously, if a cron entry had "ensure => absent" with no command specified and the crontab contained unmanaged entries, the entry would fail to be removed and every other cron entry in the catalog after it would be duplicated. Paired-With: Jesse Wolfe --- lib/puppet/provider/cron/crontab.rb | 8 +------- lib/puppet/type/cron.rb | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index 8a347b331..a554363c8 100755 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -11,13 +11,7 @@ tab = case Facter.value(:operatingsystem) - Puppet::Type.type(:cron).provide( - :crontab, - :parent => Puppet::Provider::ParsedFile, - :default_target => ENV["USER"] || "root", - - :filetype => tab -) do +Puppet::Type.type(:cron).provide(:crontab, :parent => Puppet::Provider::ParsedFile, :default_target => ENV["USER"] || "root", :filetype => tab) do commands :crontab => "crontab" text_line :comment, :match => %r{^#}, :post_parse => proc { |record| diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb index 4f6ea733c..5083ca556 100755 --- a/lib/puppet/type/cron.rb +++ b/lib/puppet/type/cron.rb @@ -395,7 +395,7 @@ Puppet::Type.newtype(:cron) do unless ret case name when :command - devfail "No command, somehow" + devfail "No command, somehow" unless @parameters[:ensure].value == :absent when :special # nothing else -- cgit