summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG12
-rwxr-xr-xbin/puppetd8
-rwxr-xr-xlib/puppet/provider/cron/crontab.rb2
-rwxr-xr-xlib/puppet/provider/package/rpm.rb2
-rwxr-xr-xlib/puppet/provider/service/redhat.rb4
-rwxr-xr-xtest/ral/providers/cron/crontab.rb28
6 files changed, 49 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b0fbf7e4c..5b5148ff4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,19 @@
+ 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.
+
Modified the 'factpath' setting to automatically configure
Facter to load facts there if a new enough version of
Facter is used.
+ 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.
Added support for the --all option to puppetca --clean. If
diff --git a/bin/puppetd b/bin/puppetd
index f652e6b08..96d0e5ee8 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -10,7 +10,7 @@
#
# puppetd [-D|--daemonize|--no-daemonize] [-d|--debug] [--disable] [--enable]
# [-h|--help] [--fqdn <host name>] [-l|--logdest syslog|<file>|console]
-# [-o|--onetime] [--serve <handler>] [-t|--test]
+# [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
# [-V|--version] [-v|--verbose] [-w|--waitforcert <seconds>]
#
# = Description
@@ -57,7 +57,7 @@
# parameter, so you can specify '--server <servername>' as an argument.
#
# See the configuration file documentation at
-# http://reductivelabs.com/projects/puppet/reference/configref.html for
+# http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference for
# the full list of acceptable parameters. A commented list of all
# configuration options can also be generated by running puppetd with
# '--genconfig'.
@@ -124,6 +124,10 @@
# Enable the most common options used for testing. These are +onetime+,
# +verbose+, +ignorecache, and +no-usecacheonfailure+.
#
+# noop::
+# Use +noop+ mode where the daemon runs in a no-op or dry-run mode. This is useful
+# for seeing what changes Puppet will make without actually executing the changes.
+#
# verbose::
# Turn on verbose reporting.
#
diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb
index 7ddcc0505..e2228b15e 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/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb
index 98ca1efa6..35684e11d 100755
--- a/lib/puppet/provider/package/rpm.rb
+++ b/lib/puppet/provider/package/rpm.rb
@@ -67,7 +67,7 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr
end
cmd = [command(:rpm), "-q", "--qf", "#{NEVRAFORMAT}\n", "-p", "#{@resource[:source]}"]
- h = nevra_to_hash(execfail(cmd, Puppet::Error))
+ h = self.class.nevra_to_hash(execfail(cmd, Puppet::Error))
return h[:ensure]
end
diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service/redhat.rb
index 356f6ffbe..e2d6ac947 100755
--- a/lib/puppet/provider/service/redhat.rb
+++ b/lib/puppet/provider/service/redhat.rb
@@ -16,7 +16,6 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init do
def disable
begin
output = chkconfig(@resource[:name], :off)
- output += chkconfig("--del", @resource[:name])
rescue Puppet::ExecutionFailure
raise Puppet::Error, "Could not disable %s: %s" %
[self.name, output]
@@ -43,8 +42,7 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init do
# in the init scripts.
def enable
begin
- output = chkconfig("--add", @resource[:name])
- output += chkconfig(@resource[:name], :on)
+ output = chkconfig(@resource[:name], :on)
rescue Puppet::ExecutionFailure => detail
raise Puppet::Error, "Could not enable %s: %s" %
[self.name, detail]
diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb
index 53bd76c50..900a0478e 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