[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Markus Roberts Markus at reality.com
Wed Jul 14 10:36:44 UTC 2010


The following commit has been merged in the upstream branch:
commit 1e0d922b152cc61c15c91af49f43d5f693972579
Author: Dan Bode <dan at reductivelabs.com>
Date:   Sun Jul 4 20:51:08 2010 -0400

    [4123] - allows self.instances to correctly report state of services.
    
    Added hasstatus => true as attribute for new provider instance in init.
    
    redhat checks the hasstatus in the provider to determine service status.

diff --git a/lib/puppet/provider/service/init.rb b/lib/puppet/provider/service/init.rb
index 58b7f91..4c73845 100755
--- a/lib/puppet/provider/service/init.rb
+++ b/lib/puppet/provider/service/init.rb
@@ -51,7 +51,7 @@ Puppet::Type.type(:service).provide :init, :parent => :base do
                 next if name =~ /^\./
                 next if exclude.include? name 
                 next if not FileTest.executable?(fullpath)
-                instances << new(:name => name, :path => path)
+                instances << new(:name => name, :path => path, :hasstatus => true)
             end
         end
         instances
diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service/redhat.rb
index 065efe6..ddcbe0e 100755
--- a/lib/puppet/provider/service/redhat.rb
+++ b/lib/puppet/provider/service/redhat.rb
@@ -61,8 +61,9 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init, :source => :init
         raise Puppet::Error, "Do not directly call the init script for '%s'; use 'service' instead" % @resource[:name]
     end
 
+    # use hasstatus=>true when its set for the provider.
     def statuscmd
-        (@resource[:hasstatus] == :true) && [command(:service), @resource[:name], "status"]
+        ((@resource.provider.get(:hasstatus) == true) || (@resource[:hasstatus] == :true)) && [command(:service), @resource[:name], "status"]
     end
 
     def restartcmd

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list