summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-03-24 15:17:04 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit1c5b3d7d4457a7c2e643a3ac160a95f14b347397 (patch)
treeea004af1b8043d528891320adb7ab5d98e1a5737
parente6a720b67abc16e0a008021b8192f84c11060635 (diff)
downloadpuppet-1c5b3d7d4457a7c2e643a3ac160a95f14b347397.tar.gz
puppet-1c5b3d7d4457a7c2e643a3ac160a95f14b347397.tar.xz
puppet-1c5b3d7d4457a7c2e643a3ac160a95f14b347397.zip
Fixes #3113 - When importing a manifest puppet needs to chill
-rwxr-xr-xlib/puppet/provider/service/smf.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/provider/service/smf.rb b/lib/puppet/provider/service/smf.rb
index 0071a8c93..957a1ae82 100755
--- a/lib/puppet/provider/service/smf.rb
+++ b/lib/puppet/provider/service/smf.rb
@@ -70,13 +70,15 @@ 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
end
-
case state
when "online"
#self.warning "matched running %s" % line.inspect