summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-07-17 11:12:35 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-07-17 11:13:01 +1000
commitde6aec6e37edb9c575f9223686da03cea4063ad7 (patch)
treef9a6fa2efb700e3fe64a3186cb901973f36599ea
parent0a0fcafa3e2405aa18ecc62d1e6dc69bbd9883a1 (diff)
downloadpuppet-de6aec6e37edb9c575f9223686da03cea4063ad7.tar.gz
puppet-de6aec6e37edb9c575f9223686da03cea4063ad7.tar.xz
puppet-de6aec6e37edb9c575f9223686da03cea4063ad7.zip
Fix Ticket 1426 - services on redhat are restarted again
as far I see there have been a regression while refactoring the redhat service provider to user /sbin/service. This commit fixes this bug (1426) and service restarts are working again on redhat based systems. There are no tests, as I couldn't figure out how that should be tested. It seems that some restart logic is already tested, however it looks like not every single kind of provider is covered by tests, nor I see at the moment how I could do that.
-rw-r--r--CHANGELOG3
-rwxr-xr-xlib/puppet/provider/service/redhat.rb12
2 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9af050dd2..0cb38e4fd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,7 @@
0.24.5
+ Fix #1426 - services on redhat are restarted again and status is
+ called from the Red Hat provider
+
Fixed #1414 - Return code from waitpid now right shifted 8 bits
Fixed #174 - a native type type for managing ssh authorized_keys
diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service/redhat.rb
index e2d6ac947..48da577ec 100755
--- a/lib/puppet/provider/service/redhat.rb
+++ b/lib/puppet/provider/service/redhat.rb
@@ -50,10 +50,18 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init do
end
def restart
- if @resource[:hasrestart] == true
+ if @resource[:hasrestart] == :true
service(@resource[:name], "restart")
else
- return false
+ super
+ end
+ end
+
+ def status
+ if @resource[:hasstatus] == :true
+ service(@resource[:name], "status")
+ else
+ super
end
end