aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2018-11-10 16:44:17 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-12-13 10:58:51 +0000
commit55a21b9ef43d596a797325379b8acd3100850b50 (patch)
tree6989ce019b95d484760cf37ae9f432cb32dbfa09
parent9db825247452d54152f1c866b6b90f897be32f15 (diff)
downloadsos-55a21b9ef43d596a797325379b8acd3100850b50.tar.gz
[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 <pmoravec@redhat.com>
-rw-r--r--sos/plugins/composer.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/sos/plugins/composer.py b/sos/plugins/composer.py
new file mode 100644
index 00000000..34901bce
--- /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 :