aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-07-06 17:31:44 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-07-06 17:31:44 +0100
commit4a57c54216242acb009fdb107d52712decfdfc1e (patch)
treec933aa59cb3616055fcce97eceed1d6134356ba7
parentf92205495113a8403066e911baeb4f5ee59c2101 (diff)
downloadsos-4a57c54216242acb009fdb107d52712decfdfc1e.tar.gz
[openvswitch] consolidate self.add_cmd_output() calls
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/openvswitch.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py
index 4dd15b2c..8d691dcd 100644
--- a/sos/plugins/openvswitch.py
+++ b/sos/plugins/openvswitch.py
@@ -24,28 +24,32 @@ class OpenVSwitch(Plugin):
profiles = ('network', 'virt')
def setup(self):
+
self.add_copy_spec([
"/var/log/openvswitch/ovs-vswitchd.log",
"/var/log/openvswitch/ovsdb-server.log"
])
- # The '-s' option enables dumping of packet counters on the
- # ports.
- self.add_cmd_output("ovs-dpctl -s show")
- # The '-t 5' adds an upper bound on how long to wait to connect
- # to the Open vSwitch server, avoiding hangs when running sosreport.
- self.add_cmd_output("ovs-vsctl -t 5 show")
+ self.add_cmd_output([
+ # The '-s' option enables dumping of packet counters on the
+ # ports.
+ "ovs-dpctl -s show",
+ # The '-t 5' adds an upper bound on how long to wait to connect
+ # to the Open vSwitch server, avoiding hangs when running sos.
+ "ovs-vsctl -t 5 show",
+ # Gather the database.
+ "ovsdb-client dump"
+ ])
# Gather additional output for each OVS bridge on the host.
br_list_result = self.call_ext_prog("ovs-vsctl list-br")
if br_list_result['status'] == 0:
for br in br_list_result['output'].splitlines():
- self.add_cmd_output("ovs-ofctl show %s" % br)
- self.add_cmd_output("ovs-ofctl dump-flows %s" % br)
- self.add_cmd_output("ovs-appctl fdb/show %s" % br)
-
- # Gather the database.
- self.add_cmd_output("ovsdb-client dump")
+ self.add_cmd_output([
+ "ovs-ofctl show %s" % br,
+ "ovs-ofctl dump-flows %s" % br,
+ "ovs-appctl fdb/show %s" % br
+ ])
class RedHatOpenVSwitch(OpenVSwitch, RedHatPlugin):