components/ruby/puppet/patches/puppet-06-provider-smf.patch
changeset 2081 1f1144fb0e4e
parent 1655 2490bf4f53ea
child 5860 afd31ba91ee9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ruby/puppet/patches/puppet-06-provider-smf.patch	Fri Sep 12 10:57:15 2014 -0600
@@ -0,0 +1,24 @@
+Add check for existence of smf service
+--- puppet-3.6.2/lib/puppet/provider/service/smf.rb.orig	2013-07-15 09:23:24.667341073 -0600
++++ puppet-3.6.2/lib/puppet/provider/service/smf.rb	2013-07-15 10:13:03.196178924 -0600
+@@ -80,9 +80,18 @@
+       return
+     end
+ 
++    # get the current state and the next state, and if the next
++    # state is set (i.e. not "-") use it for state comparison
++
++    # Check to see if the service exists
++    cmd = Array[command(:svccfg), "select", @resource[:name]]
++    output = Puppet::Util::Execution.execute(
++        cmd, :combine => true, :failonfail => false)
++    if $CHILD_STATUS.exitstatus != 0
++      info output
++    end
++
+     begin
+-      # get the current state and the next state, and if the next
+-      # state is set (i.e. not "-") use it for state comparison
+       states = svcs("-H", "-o", "state,nstate", @resource[:name]).chomp.split
+       state = states[1] == "-" ? states[0] : states[1]
+     rescue Puppet::ExecutionFailure