aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2018-09-03 17:11:06 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-09-03 17:11:06 +0100
commit77c72b415feccd828fd7bc13caebf9841afc40c2 (patch)
tree8b00ba5ebb140b1d087cc0a5459c43dd8133dd3a
parent64d7cccf48aee9a07e2e4c5237034638cae30391 (diff)
downloadsos-77c72b415feccd828fd7bc13caebf9841afc40c2.tar.gz
[docker] combine docker 'inspect' and 'logs' loops
We're iterating over all the containers: might as well only do it one time. Related: #1406, #1407 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/docker.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
index a44264a4..5b2acff5 100644
--- a/sos/plugins/docker.py
+++ b/sos/plugins/docker.py
@@ -80,9 +80,7 @@ class Docker(Plugin):
if insp:
for container in insp:
self.add_cmd_output("docker inspect %s" % container)
-
- if self.get_option('logs'):
- for container in insp:
+ if self.get_option('logs'):
self.add_cmd_output("docker logs -t %s" % container)