summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2010-03-24 09:38:05 +1100
committerJames Turnbull <james@lovedthanlost.net>2010-03-24 09:38:05 +1100
commit74cd55fbda7edf64b6bbd77143ea3f1fbdf39e30 (patch)
treec058447e94ea22abb5bade5f83e427b3124fc15a
parent7ec50a74f81264591208fb55e01567ee795ab6b8 (diff)
downloadpuppet-74cd55fbda7edf64b6bbd77143ea3f1fbdf39e30.tar.gz
puppet-74cd55fbda7edf64b6bbd77143ea3f1fbdf39e30.tar.xz
puppet-74cd55fbda7edf64b6bbd77143ea3f1fbdf39e30.zip
Fixes #3113 - When importing a manifest puppet needs to chill
-rwxr-xr-xlib/puppet/provider/service/smf.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/provider/service/smf.rb b/lib/puppet/provider/service/smf.rb
index 0071a8c93..f7f3a3128 100755
--- a/lib/puppet/provider/service/smf.rb
+++ b/lib/puppet/provider/service/smf.rb
@@ -70,7 +70,10 @@ Puppet::Type.type(:service).provide :smf, :parent => :base do
end
begin
- state = svcs("-H", "-o", "state", @resource[:name]).chomp
+ # 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
info "Could not get status on service %s" % self.name
return :stopped