From 123298b15526948f6d0a6d91e9ab19cef72b3b4b Mon Sep 17 00:00:00 2001 From: PavelAF <65919272+PavelAF@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:13:09 +0300 Subject: [PATCH] fix ifreload ovs_options clear --- ifupdown2/addons/openvswitch.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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)