Skip to content

Commit

Permalink
Get container statuses during refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Demichev committed Sep 25, 2018
1 parent dc331ac commit 8b9d26d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,12 @@ def refresh_services(ssu)
services = MiqLinux::Utils.parse_chkconfig_list(services)
end

services.each do |service|
containers = ssu.shell_exec("docker ps --format 'table {{.Names}}\t{{.Status}}' | tail -n +2")
if containers
containers = MiqLinux::Utils.parse_docker_ps_list(containers)
end

(services + containers).each do |service|
s = xml.add_element(:service,
'name' => service[:name],
'systemd_load' => service[:systemd_load],
Expand Down

0 comments on commit 8b9d26d

Please sign in to comment.