diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rwxr-xr-x | lib/puppet/provider/cron/crontab.rb | 6 | ||||
-rwxr-xr-x | test/ral/providers/cron/crontab.rb | 9 |
3 files changed, 12 insertions, 5 deletions
@@ -7,6 +7,8 @@ Fixed #1012 - templates in the templatedir are preferred to module templates. + Fixed #707 - special '@reboot'-style cron jobs work again. + Fixed #1360 - allowdupe works on groups again. Fixed #1369 - the init service provider now supports HP-UX. diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index e2228b15e..1cfa0f5fd 100755 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -69,7 +69,11 @@ Puppet::Type.type(:cron).provide(:crontab, end end - str += join(record) + if record[:special] + str += "@%s %s" % [record[:special], record[:command]] + else + str += join(record) + end str end end diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb index 900a0478e..d9f460258 100755 --- a/test/ral/providers/cron/crontab.rb +++ b/test/ral/providers/cron/crontab.rb @@ -530,8 +530,6 @@ class TestCronParsedProvider < Test::Unit::TestCase @provider.initvars str += "\n" target.write(str) - assert_equal(str, target.read, - "Did not write correctly") assert_nothing_raised("Could not prefetch with %s" % str.inspect) do @provider.prefetch end @@ -551,6 +549,11 @@ class TestCronParsedProvider < Test::Unit::TestCase end end + # #707 + def test_write_freebsd_special + assert_equal(@provider.to_line(:record_type => :crontab, :ensure => :present, :special => "reboot", :command => "/bin/echo something"), "@reboot /bin/echo something") + end + def test_prefetch cron = @type.create :command => "/bin/echo yay", :name => "test", :hour => 4 @@ -626,6 +629,4 @@ class TestCronParsedProvider < Test::Unit::TestCase assert_equal(v, is[p], "did not parse %s correctly" % p) end end - end - |