aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2016-07-13 15:13:35 +0100
committerBryn M. Reeves <bmr@redhat.com>2016-07-13 15:13:35 +0100
commite2d85366ef5b6f02e12e0ce353a0ccaa22ae8bbc (patch)
tree8751cb3db9fa70259b6dac511320a2511328621a
parent46da5439bb79f294dca8019293eecf3096e5b999 (diff)
downloadsos-e2d85366ef5b6f02e12e0ce353a0ccaa22ae8bbc.tar.gz
[atomichost] improve 'atomic info' collection loop
Remove redundant code from the loop that drives 'atomic info' collection and make the bracketing and indenting style match other plugins. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/atomichost.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/sos/plugins/atomichost.py b/sos/plugins/atomichost.py
index a339557e..9b53d56b 100644
--- a/sos/plugins/atomichost.py
+++ b/sos/plugins/atomichost.py
@@ -34,8 +34,9 @@ class AtomicHost(Plugin, RedHatPlugin):
self.add_cmd_output("atomic host status")
if self.get_option('info'):
- images = self.get_command_output("docker images -q")
- for image in set(
- images['output'].splitlines()):
- if image:
- self.add_cmd_output("atomic info {0}".format(image))
+ # images output may have trailing whitespace
+ images = self.get_command_output("docker images -q").strip()
+ for image in set(images['output'].splitlines()):
+ self.add_cmd_output("atomic info {0}".format(image))
+
+# vim: set et ts=4 sw=4 :