diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2017-05-10 08:18:49 -0400 |
---|---|---|
committer | Adam Stokes <battlemidget@users.noreply.github.com> | 2017-05-10 08:18:49 -0400 |
commit | ad26d98086ba516a28ce9d3c166da70807cdeb97 (patch) | |
tree | e7997c3bc4d9407a3c0048f2ec8cd8e08fd42cbc | |
parent | 2c0bf8b2581dbe31ea5bebcbdae8cdf62a3e92c7 (diff) | |
download | sos-ad26d98086ba516a28ce9d3c166da70807cdeb97.tar.gz |
[docker] Collect image inspect output (#995)
Adds output for 'docker inspect' for each unique image on the host.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
-rw-r--r-- | sos/plugins/docker.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py index ffe5cfce..6e5a0b2e 100644 --- a/sos/plugins/docker.py +++ b/sos/plugins/docker.py @@ -77,10 +77,18 @@ class Docker(Plugin): if self.get_option('all'): ps_cmd = "{0} -a".format(ps_cmd) - result = self.get_command_output(ps_cmd) - if result['status'] == 0: - containers = [c for c in result['output'].splitlines()] - for container in containers: + img_cmd = '{0} images -q'.format(self.docker_cmd) + insp = set() + + for icmd in [ps_cmd, img_cmd]: + result = self.get_command_output(icmd) + if result['status'] == 0: + for con in result['output'].splitlines(): + insp.add(con) + + insp = list(insp) + if insp: + for container in insp: self.add_cmd_output( "{0} inspect {1}".format( self.docker_cmd, |