diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2018-03-28 16:30:00 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-03-28 16:30:00 +0100 |
commit | c93e2f96e29744edb25a4aa1943798eb517b6bef (patch) | |
tree | dd82c53282bb2b90278c0f3a66a87c01f368a27f | |
parent | 697ff365be872fb594a1eb3e695d45f717116d6b (diff) | |
download | sos-c93e2f96e29744edb25a4aa1943798eb517b6bef.tar.gz |
[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 <bmr@redhat.com>
-rw-r--r-- | sos/plugins/ovirt.py | 19 |
1 files 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([ |