components/ruby/puppet/patches/puppet-06-provider-smf.patch
author Kristina Tripp <Kristina.Tripp@oracle.com>
Fri, 07 Nov 2014 12:43:50 -0800
branchs11u2-sru
changeset 3460 5c5af6e58474
parent 2928 components/puppet/patches/puppet-06-provider-smf.patch@43b3da52b84a
permissions -rw-r--r--
18960221 problem in UTILITY/PUPPET 18960237 Update Puppet to 3.6.2 19612179 Prepare puppet code to support multiple or different releases of ruby 19652539 gmake install of puppet fails due to Makefile omission 19646558 puppet-19 package not installed if ruby-19 not installed 19685659 salvage warning upgrading puppet 19988165 Puppet <name>~ files from patch process are included in puppet-19 package
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2771
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     1
Add check for existence of smf service
3460
5c5af6e58474 18960221 problem in UTILITY/PUPPET
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 2928
diff changeset
     2
--- puppet-3.6.2/lib/puppet/provider/service/smf.rb.orig	2013-07-15 09:23:24.667341073 -0600
5c5af6e58474 18960221 problem in UTILITY/PUPPET
Kristina Tripp <Kristina.Tripp@oracle.com>
parents: 2928
diff changeset
     3
+++ puppet-3.6.2/lib/puppet/provider/service/smf.rb	2013-07-15 10:13:03.196178924 -0600
2771
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     4
@@ -80,9 +80,18 @@
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     5
       return
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     6
     end
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     7
 
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     8
+    # get the current state and the next state, and if the next
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
     9
+    # state is set (i.e. not "-") use it for state comparison
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    10
+
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    11
+    # Check to see if the service exists
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    12
+    cmd = Array[command(:svccfg), "select", @resource[:name]]
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    13
+    output = Puppet::Util::Execution.execute(
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    14
+        cmd, :combine => true, :failonfail => false)
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    15
+    if $CHILD_STATUS.exitstatus != 0
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    16
+      info output
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    17
+    end
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    18
+
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    19
     begin
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    20
-      # get the current state and the next state, and if the next
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    21
-      # state is set (i.e. not "-") use it for state comparison
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    22
       states = svcs("-H", "-o", "state,nstate", @resource[:name]).chomp.split
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    23
       state = states[1] == "-" ? states[0] : states[1]
8e4227dc2fc4 16453463 Update Puppet's offerings on Solaris
Virginia Wray <virginia.wray@oracle.com>
parents:
diff changeset
    24
     rescue Puppet::ExecutionFailure