65: def status
66: execute([command(:lssrc), "-s", @resource[:name]]).each do |line|
67: args = line.split
68:
69:
70: next unless args[0] == @resource[:name]
71:
72:
73:
74: state = case args[-1]
75: when "active" then :running
76: when "inoperative" then :stopped
77: end
78: Puppet.debug("Service #{@resource[:name]} is #{args[-1]}")
79: return state
80: end
81: self.fail("No such service found")
82: rescue Puppet::ExecutionFailure => detail
83: raise Puppet::Error.new("Cannot get status of #{@resource[:name]}, error was: #{detail}" )
84: end