diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2016-05-24 17:47:43 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2016-05-24 17:47:43 +0100 |
commit | 347502277525516ba3fd0321d0814c7c8b34580d (patch) | |
tree | 6ad1c51cf359874df41166e8505086825117b513 | |
parent | 69663124b7b841d8f0847238bd5dfbf800dd8f07 (diff) | |
download | sos-347502277525516ba3fd0321d0814c7c8b34580d.tar.gz |
[lvm2] use variable for path building
Use a variable to build the path to be passed to lvmdump rather
than building it in-situ in the add_cmd_output() call.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/lvm2.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sos/plugins/lvm2.py b/sos/plugins/lvm2.py index 6079229f..2b735046 100644 --- a/sos/plugins/lvm2.py +++ b/sos/plugins/lvm2.py @@ -31,13 +31,15 @@ class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """Collects an lvmdump in standard format with optional metadata archives for each physical volume present. """ + lvmdump_path = self.get_cmd_output_path(name="lvmdump", make=False) lvmdump_cmd = "lvmdump %s -d '%s'" lvmdump_opts = "" + if metadata: lvmdump_opts = "-a -m" - cmd = lvmdump_cmd % (lvmdump_opts, - self.get_cmd_output_path(name="lvmdump", - make=False)) + + cmd = lvmdump_cmd % (lvmdump_opts, lvmdump_path) + self.add_cmd_output(cmd, chroot=self.tmp_in_sysroot()) def setup(self): |