From 74cd55fbda7edf64b6bbd77143ea3f1fbdf39e30 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Wed, 24 Mar 2010 09:38:05 +1100 Subject: Fixes #3113 - When importing a manifest puppet needs to chill --- lib/puppet/provider/service/smf.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit