[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. 90c4a6028cf6ebd530af736ce08f1b413698b162
Micah Anderson
micah at riseup.net
Sat May 31 17:15:33 UTC 2008
The following commit has been merged in the master branch:
commit 8bd46f48ef2d3a320899fe0a61c893946e79b107
Author: James Turnbull <james at lovedthanlost.net>
Date: Fri May 16 16:49:22 2008 +1000
Crontab provider: fix a parse error when a line begins with a space character
Tests for Bug #1216
Updated CHANGELOG
diff --git a/CHANGELOG b/CHANGELOG
index a0c5a12..870afb9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,14 @@
- Instead of deleting the init scripts (with --del) we should simply disable
- it with chkconfig service off, and respectfully do the same for enable
- => true;
+ Moving all confine code out of the Provider class, and fixing #1197.
+ Created a Confiner module for the Provider class methods, enhanced
+ the interface between it and the Confine class to make sure binary
+ paths are searched for fresh each time.
+
+ Crontab provider: fix a parse error when a line begins with a space
+ character (fixes #1216)
+
+ Instead of deleting the init scripts (with --del) we should simply
+ disable it with chkconfig service off, and respectfully do the same
+ for enable => true;
Added ldap providers for users and groups.
diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb
index 7ddcc05..e2228b1 100755
--- a/lib/puppet/provider/cron/crontab.rb
+++ b/lib/puppet/provider/cron/crontab.rb
@@ -30,7 +30,7 @@ Puppet::Type.type(:cron).provide(:crontab,
}
crontab = record_line :crontab, :fields => %w{minute hour monthday month weekday command},
- :match => %r{^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$},
+ :match => %r{^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$},
:optional => %w{minute hour weekday month monthday}, :absent => "*"
class << crontab
diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb
index 53bd76c..900a047 100755
--- a/test/ral/providers/cron/crontab.rb
+++ b/test/ral/providers/cron/crontab.rb
@@ -599,5 +599,33 @@ class TestCronParsedProvider < Test::Unit::TestCase
result = target.read
assert_equal("# Puppet Name: test\n* 4 * * * /bin/echo yay\n", result, "Did not write out environment setting")
end
+
+ # Testing #1216
+ def test_strange_lines
+ @provider.stubs(:filetype).returns(Puppet::Util::FileType.filetype(:ram))
+ text = " 5 \t\t 1,2 * 1 0 /bin/echo funtest"
+
+ records = nil
+ assert_nothing_raised {
+ records = @provider.parse(text)
+ }
+
+ should = {
+ :minute => %w{5},
+ :hour => %w{1 2},
+ :monthday => :absent,
+ :month => %w{1},
+ :weekday => %w{0},
+ :command => "/bin/echo funtest"
+ }
+
+ is = records.shift
+ assert(is, "Did not get record")
+
+ should.each do |p, v|
+ assert_equal(v, is[p], "did not parse %s correctly" % p)
+ end
+ end
+
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list