From 4a57c54216242acb009fdb107d52712decfdfc1e Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Mon, 6 Jul 2015 17:31:44 +0100 Subject: [openvswitch] consolidate self.add_cmd_output() calls Signed-off-by: Bryn M. Reeves --- sos/plugins/openvswitch.py | 28 ++++++++++++++++------------ 1 file 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): -- cgit