equal
deleted
inserted
replaced
1 Add check for existence of smf service |
|
2 --- puppet-3.4.1/lib/puppet/provider/service/smf.rb.orig 2013-07-15 09:23:24.667341073 -0600 |
|
3 +++ puppet-3.4.1/lib/puppet/provider/service/smf.rb 2013-07-15 10:13:03.196178924 -0600 |
|
4 @@ -80,9 +80,18 @@ |
|
5 return |
|
6 end |
|
7 |
|
8 + # get the current state and the next state, and if the next |
|
9 + # state is set (i.e. not "-") use it for state comparison |
|
10 + |
|
11 + # Check to see if the service exists |
|
12 + cmd = Array[command(:svccfg), "select", @resource[:name]] |
|
13 + output = Puppet::Util::Execution.execute( |
|
14 + cmd, :combine => true, :failonfail => false) |
|
15 + if $CHILD_STATUS.exitstatus != 0 |
|
16 + info output |
|
17 + end |
|
18 + |
|
19 begin |
|
20 - # get the current state and the next state, and if the next |
|
21 - # state is set (i.e. not "-") use it for state comparison |
|
22 states = svcs("-H", "-o", "state,nstate", @resource[:name]).chomp.split |
|
23 state = states[1] == "-" ? states[0] : states[1] |
|
24 rescue Puppet::ExecutionFailure |
|