From 55a21b9ef43d596a797325379b8acd3100850b50 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sat, 10 Nov 2018 16:44:17 +0100 Subject: [PATCH] [composer] New plugin for lorax-composer lorax-composer is an API server for building disk images using Blueprints. The plugin collects composer config and logs and few composer-cli command outputs. Resolves: #1477 Signed-off-by: Pavel Moravec --- sos/plugins/composer.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sos/plugins/composer.py diff --git a/sos/plugins/composer.py b/sos/plugins/composer.py new file mode 100644 index 000000000..34901bcee --- /dev/null +++ b/sos/plugins/composer.py @@ -0,0 +1,39 @@ +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class Composer(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """Lorax Composer + """ + + plugin_name = 'composer' + profiles = ('sysmgmt', 'virt', ) + + packages = ('composer-cli',) + + def _get_blueprints(self): + blueprints = [] + bp_result = self.get_command_output("composer-cli blueprints list") + if bp_result['status'] != 0: + return blueprints + for line in bp_result['output'].splitlines(): + blueprints.append(line) + return blueprints + + def setup(self): + self.add_copy_spec([ + "/etc/lorax/composer.conf", + "/var/log/lorax-composer/composer.log" + "/var/log/lorax-composer/dnf.log" + "/var/log/lorax-composer/program.log" + "/var/log/lorax-composer/server.log" + ]) + blueprints = self._get_blueprints() + for blueprint in blueprints: + self.add_cmd_output("composer-cli blueprints show %s" % blueprint) + + self.add_cmd_output([ + "composer-cli blueprints list", + "composer-cli sources list" + ]) + +# vim: set et ts=4 sw=4 : From 7907bb4fbb3279d61d30d46372bc729557a5049a Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Thu, 10 Jan 2019 15:18:04 +0100 Subject: [PATCH] [composer] add missing commas in list in add_copy_spec Resolves: #1535 Signed-off-by: Pavel Moravec --- sos/plugins/composer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sos/plugins/composer.py b/sos/plugins/composer.py index ff3aa49b..0f926398 100644 --- a/sos/plugins/composer.py +++ b/sos/plugins/composer.py @@ -22,10 +22,10 @@ class Composer(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): def setup(self): self.add_copy_spec([ "/etc/lorax/composer.conf", - "/var/log/lorax-composer/composer.log" - "/var/log/lorax-composer/dnf.log" - "/var/log/lorax-composer/program.log" - "/var/log/lorax-composer/server.log" + "/var/log/lorax-composer/composer.log", + "/var/log/lorax-composer/dnf.log", + "/var/log/lorax-composer/program.log", + "/var/log/lorax-composer/server.log", ]) blueprints = self._get_blueprints() for blueprint in blueprints: -- 2.17.2