Skip to content

Commit

Permalink
Merge pull request #18016 from alexander-demichev/containerized-services
Browse files Browse the repository at this point in the history
Get container statuses during refresh
  • Loading branch information
agrare authored Oct 5, 2018
2 parents 41f44af + ad7fb6f commit baf440e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1091,9 +1091,7 @@ def refresh_patches(ssu)
Patch.refresh_patches(self, patches)
end

def refresh_services(ssu)
xml = MiqXml.createDoc(:miq).root.add_element(:services)

def collect_services(ssu)
services = ssu.shell_exec("systemctl -a --type service --no-legend")
if services
# If there is a systemd use only that, chconfig is calling systemd on the background, but has misleading results
Expand All @@ -1102,6 +1100,12 @@ def refresh_services(ssu)
services = ssu.shell_exec("chkconfig --list")
services = MiqLinux::Utils.parse_chkconfig_list(services)
end
end

def refresh_services(ssu)
xml = MiqXml.createDoc(:miq).root.add_element(:services)

services = collect_services(ssu)

services.each do |service|
s = xml.add_element(:service,
Expand Down

0 comments on commit baf440e

Please sign in to comment.