Skip to content
Open
Changes from all commits
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
20 changes: 10 additions & 10 deletions ifupdown2/addons/openvswitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,6 @@ def _addbridge (self, ifaceobj):

cmd_list = []

cmd = "--may-exist add-br %s"%(iface)
if ovsparent is not None and ovsoptions:
cmd = cmd + " %s" %(ovsoptions)

cmd_list.append(cmd)

if ovsparent is None and ovsoptions:
cmd = "set bridge %s %s" %(iface, ovsoptions)
cmd_list.append(cmd)

#update
if self.cache.link_exists (iface):
# on update, delete active ports not in the new port list
Expand Down Expand Up @@ -192,6 +182,16 @@ def _addbridge (self, ifaceobj):
cmd = "--if-exists clear interface %s mtu_request external-ids other_config options"%(iface)
cmd_list.append(cmd)

cmd = "--may-exist add-br %s"%(iface)
if ovsparent is not None and ovsoptions:
cmd = cmd + " %s" %(ovsoptions)

cmd_list.append(cmd)

if ovsparent is None and ovsoptions:
cmd = "set bridge %s %s" %(iface, ovsoptions)
cmd_list.append(cmd)

if ovsextra is not None:
cmd_list.extend(ovsextra)

Expand Down