diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-04-14 22:09:23 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-04-14 22:09:23 +0100 |
commit | 74b88d7b69a0106e45a4ade9117a02427d0d319d (patch) | |
tree | a234d2834680a28dfa826ac4cefe610cda634c4c | |
parent | d49a3c4c5e17a2e609da455790f1077a4a606994 (diff) | |
download | sos-74b88d7b69a0106e45a4ade9117a02427d0d319d.tar.gz |
Fix dmraid metadata collection and make it optional
The dmraid command writes metadata dumps into the current working
directory. This is normally /tmp meaning that the files are
created outside the archive.
Use runat to change directory to the appropriate path in the
archive before running the command and add an option to control
metadata collection.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/dmraid.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sos/plugins/dmraid.py b/sos/plugins/dmraid.py index 78d4a940..4061cf28 100644 --- a/sos/plugins/dmraid.py +++ b/sos/plugins/dmraid.py @@ -19,6 +19,10 @@ class Dmraid(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """dmraid related information """ + option_list = [( + "metadata", "capture metadata from dmraid devices", "slow", False + )] + plugin_name = 'dmraid' # V - {-V/--version} # b - {-b|--block_devices} @@ -27,10 +31,13 @@ class Dmraid(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): # t - [-t|--test] # a - {-a|--activate} {y|n|yes|no} # D - [-D|--dump_metadata] - dmraid_options = ['V','b','r','s','tay','rD'] + dmraid_options = ['V','b','r','s','tay'] def setup(self): for opt in self.dmraid_options: self.add_cmd_output("dmraid -%s" % (opt,)) + if self.get_option("metadata"): + metadata_path = self.get_cmd_output_path("metadata") + self.add_cmd_output("dmraid -rD", runat=metadata_path) # vim: et ts=4 sw=4 |