gtk+3: fix dependencies for new gnome/accessibility/at-spi2-core
[oi-userland.git] / components / ruby / puppet / patches / puppet-11-smf-degraded.patch
blob81be71ce8e2584aa3a4196df3d295108ccba0734
1 Add support for degraded state in smf and remove unused variable stime.
2 Submitted upstream as PUP-6095
4 --- puppet-3.8.6/lib/puppet/provider/service/smf.rb.orig 2016-04-19 14:56:32.596751150 -0700
5 +++ puppet-3.8.6/lib/puppet/provider/service/smf.rb 2016-04-19 14:59:32.495860166 -0700
6 @@ -36,11 +36,12 @@
7 end
9 def self.instances
10 - svcs("-H").split("\n").select{|l| l !~ /^legacy_run/ }.collect do |line|
11 - state,stime,fmri = line.split(/\s+/)
12 + svcs("-H", "-o", "state,fmri" ).split("\n").select{|l| l !~ /^legacy_run/ }.collect do |line|
13 + state,fmri = line.split(/\s+/)
14 status = case state
15 when /online/; :running
16 when /maintenance/; :maintenance
17 + when /degraded/; :degraded
18 else :stopped
19 end
20 new({:name => fmri, :ensure => status})
21 @@ -71,7 +72,7 @@
22 def startcmd
23 self.setupservice
24 case self.status
25 - when :maintenance
26 + when :maintenance, :degraded
27 [command(:adm), :clear, @resource[:name]]
28 else
29 [command(:adm), :enable, "-rs", @resource[:name]]
30 @@ -112,6 +113,8 @@
31 return :stopped
32 when "maintenance"
33 return :maintenance
34 + when "degraded"
35 + return :degraded
36 when "legacy_run"
37 raise Puppet::Error,
38 "Cannot manage legacy services through SMF"