diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-07-31 18:08:56 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-07-31 18:08:56 +0100 |
commit | 971e36df8cd3e9b6668175e84639a013f71cdb8e (patch) | |
tree | 8a43a726a3ed67b69e0b6295de7ac3e3cfb71fba | |
parent | c8ec7041ba13edd7d62a08da6210d6e85554d0c2 (diff) | |
download | sos-971e36df8cd3e9b6668175e84639a013f71cdb8e.tar.gz |
[gluster] tidy up add_copy_spec() usage
The gluster plugin has a pile of fragmented add_copy_spec() calls.
Consolidate them into as few add_copy_specs() calls as possible
and remove the cargo-cult positioning of logs at the end.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/gluster.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py index 538e1b27..193873d1 100644 --- a/sos/plugins/gluster.py +++ b/sos/plugins/gluster.py @@ -78,19 +78,20 @@ class Gluster(Plugin, RedHatPlugin): pass def setup(self): - self.add_cmd_output("gluster peer status") - - self.add_copy_spec("/var/lib/glusterd/") self.add_forbidden_path("/var/lib/glusterd/geo-replication/secret.pem") - # collect unified file and object storage configuration - self.add_copy_spec("/etc/swift/") - - # glusterfs-server rpm scripts stash this on migration to 3.3.x - self.add_copy_spec("/etc/glusterd.rpmsave") + self.add_cmd_output("gluster peer status") - # common to all versions - self.add_copy_spec("/etc/glusterfs") + self.add_copy_specs([ + # collect unified file and object storage configuration + "/etc/swift/", + # glusterfs-server rpm scripts stash this on migration to 3.3.x + "/etc/glusterd.rpmsave", + # common to all versions + "/etc/glusterfs", + "/var/lib/glusterd/", + "/var/log/glusterfs" + ]) self.make_preparations(self.statedump_dir) if self.check_ext_prog("killall -USR1 glusterfs glusterfsd"): @@ -103,16 +104,12 @@ class Gluster(Plugin, RedHatPlugin): else: self.soslog.info("could not send SIGUSR1 to glusterfs processes") - volume_file = self.get_cmd_output_now("gluster volume info", - "gluster_volume_info") + volume_file = self.get_cmd_output_now("gluster volume info") if volume_file: for volname in self.get_volume_names(volume_file): self.add_cmd_output("gluster volume geo-replication %s status" % volname) self.add_cmd_output("gluster volume status") - # collect this last as some of the other actions create log entries - self.add_copy_spec("/var/log/glusterfs") - # vim: et ts=4 sw=4 |