summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rwxr-xr-xlib/puppet/provider/cron/crontab.rb6
-rwxr-xr-xtest/ral/providers/cron/crontab.rb9
3 files changed, 12 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bbf35de19..4a7e3c93c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
-