diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py index 0a124ba2..352633a7 100644 --- a/ifupdown2/addons/openvswitch.py +++ b/ifupdown2/addons/openvswitch.py @@ -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 @@ -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)