aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2019-02-18 12:32:11 -0500
committerBryn M. Reeves <bmr@redhat.com>2019-03-04 16:46:46 +0000
commite456ae4f23e49c36d5efe6b0584c5ec29be21ba5 (patch)
treede4a3a5bc4604d295f792b4faf7e24e226bd5974
parent96e614c13cca083ee55136f311171a1a2f4e2fc7 (diff)
downloadsos-e456ae4f23e49c36d5efe6b0584c5ec29be21ba5.tar.gz
[composer] Collect sources info for all sources
Adds collection of info on each source found by composer-cli. The _get_blueprints() method has been made more generic to accomodate both blueprints and sources. Resolves: #1571 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/composer.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/sos/plugins/composer.py b/sos/plugins/composer.py
index 0f926398..e4f30f5f 100644
--- a/sos/plugins/composer.py
+++ b/sos/plugins/composer.py
@@ -10,14 +10,14 @@ class Composer(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
packages = ('composer-cli',)
- def _get_blueprints(self):
- blueprints = []
- bp_file = self.get_cmd_output_now("composer-cli blueprints list")
- if bp_file:
- with open(bp_file, "r") as bps:
- for line in bps.read().splitlines():
- blueprints.append(line)
- return blueprints
+ def _get_entries(self, cmd):
+ entries = []
+ ent_file = self.get_cmd_output_now(cmd)
+ if ent_file:
+ with open(ent_file, "r") as ents:
+ for line in ents.read().splitlines():
+ entries.append(line)
+ return entries
def setup(self):
self.add_copy_spec([
@@ -27,10 +27,12 @@ class Composer(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"/var/log/lorax-composer/program.log",
"/var/log/lorax-composer/server.log",
])
- blueprints = self._get_blueprints()
+ blueprints = self._get_entries("composer-cli blueprints list")
for blueprint in blueprints:
self.add_cmd_output("composer-cli blueprints show %s" % blueprint)
- self.add_cmd_output("composer-cli sources list")
+ sources = self._get_entries("composer-cli sources list")
+ for src in sources:
+ self.add_cmd_output("composer-cli sources info %s" % src)
# vim: set et ts=4 sw=4 :