Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
In worlddump, execute ovs-ofctl for an only existing bridge
When devstack fails, some or all bridges may not exist.
This change allows an only existing bridge to executes ovs-ofctl command.
And fix duplicate ofp version specified in protocol option of ovs-ofctl.

Change-Id: Ied01de727ca9b867ce87db358f72ae44838b63af
(cherry picked from commit 578459f)
  • Loading branch information
fkakuma committed May 28, 2016
commit a95ffa1c0b0cef065a3093bd1bf9dfc4e01ecf2e
13 changes: 8 additions & 5 deletions tools/worlddump.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def _header(name):
print


def _bridge_list():
process = subprocess.Popen(['ovs-vsctl', 'list-br'], stdout=subprocess.PIPE)
stdout, _ = process.communicate()
return stdout.split()


# This method gets a max openflow version supported by openvswitch.
# For example 'ovs-ofctl --version' displays the following:
#
Expand Down Expand Up @@ -157,14 +163,11 @@ def ovs_dump():
if not _find_cmd('ovs-vsctl'):
return

# NOTE(ihrachys): worlddump is used outside of devstack context (f.e. in
# grenade), so there is no single place to determine the bridge names from.
# Hardcode for now.
bridges = ('br-int', 'br-tun', 'br-ex')
bridges = _bridge_list()
ofctl_cmds = ('show', 'dump-ports-desc', 'dump-ports', 'dump-flows')
ofp_max = _get_ofp_version()
vers = 'OpenFlow10'
for i in range(ofp_max + 1):
for i in range(1, ofp_max + 1):
vers += ',OpenFlow1' + str(i)
_dump_cmd("sudo ovs-vsctl show")
for ofctl_cmd in ofctl_cmds:
Expand Down