aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2019-04-01 15:29:27 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-05-21 16:25:18 +0100
commit342dd6dd5d75ba0073aa88b8811c637bce9d05ae (patch)
tree3d001338a78a597f16daf36ec8f590679d7e6196
parent5c24bd6d775fd7bbfd2468e1cff6d302f8c6f978 (diff)
downloadsos-342dd6dd5d75ba0073aa88b8811c637bce9d05ae.tar.gz
[docker] Write command output to relevant subdir
Updates the plugin to write command output for specific containers, images, volumes, etc... to a subdir named for that resource. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/plugins/docker.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
index bbc18145..4a68a640 100644
--- a/sos/plugins/docker.py
+++ b/sos/plugins/docker.py
@@ -78,17 +78,20 @@ class Docker(Plugin):
volumes = self._get_docker_list(vol_cmd)
for container in containers:
- self.add_cmd_output("docker inspect %s" % container)
+ self.add_cmd_output("docker inspect %s" % container,
+ subdir='containers')
if self.get_option('logs'):
- self.add_cmd_output("docker logs -t %s" % container)
+ self.add_cmd_output("docker logs -t %s" % container,
+ subdir='containers')
for img in images:
name, img_id = img.strip().split()
insp = name if 'none' not in name else img_id
- self.add_cmd_output("docker inspect %s" % insp)
+ self.add_cmd_output("docker inspect %s" % insp, subdir='images')
for vol in volumes:
- self.add_cmd_output("docker volume inspect %s" % vol)
+ self.add_cmd_output("docker volume inspect %s" % vol,
+ subdir='volumes')
def _get_docker_list(self, cmd):
ret = []