From c93e2f96e29744edb25a4aa1943798eb517b6bef Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 28 Mar 2018 16:30:00 +0100 Subject: [ovirt] reduce line lengths by storing command names in locals The new oVirt command names are very long: define them once in local variables in setup() and reference these in collection calls. Signed-off-by: Bryn M. Reeves --- sos/plugins/ovirt.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sos/plugins/ovirt.py b/sos/plugins/ovirt.py index 630bc6e1..fba9ab00 100644 --- a/sos/plugins/ovirt.py +++ b/sos/plugins/ovirt.py @@ -88,23 +88,22 @@ class Ovirt(Plugin, RedHatPlugin): self.add_cmd_output("engine-config --all") # 3.x line uses engine-manage-domains, 4.x uses ovirt-aaa-jdbc-tool - if is_executable('engine-manage-domains'): - self.add_cmd_output('engine-manage-domains list') - if is_executable('ovirt-engine-extensions-tool'): - self.add_cmd_output( - 'ovirt-engine-extensions-tool info list-extensions' - ) + manage_domains = 'engine-manage-domains' + extensions_tool = 'ovirt-engine-extensions-tool' + jdbc_tool = 'ovirt-aaa-jdbc-tool' + + if is_executable(manage_domains): + self.add_cmd_output('%s list' % manage_domains) + if is_executable(extensions_tool): + self.add_cmd_output('%s info list-extensions' % extensions_tool) if is_executable('ovirt-aaa-jdbc-tool'): - cmd = 'ovirt-aaa-jdbc-tool' subcmds = [ 'query --what=user', 'query --what=group', 'settings show' ] - self.add_cmd_output([ - '%s %s' % (cmd, sub) for sub in subcmds - ]) + self.add_cmd_output(['%s %s' % (jdbc_tool, sc) for sc in subcmds]) # Copy engine config files. self.add_copy_spec([ -- cgit