From d4ac2a6f993bd88b2d81e732904d02d46a3e5d45 Mon Sep 17 00:00:00 2001 From: Eik Rentzow Date: Tue, 15 Oct 2024 12:27:51 +0000 Subject: [PATCH] openvswitch.py fix fake bridge parent This fixes issue #313 where the ovs_bridge parameter for fake bridges was not applied. This fix is backward compatible to the workaround where the parent bridge name is repeated at the beginning of the ovs_options parameter. --- ifupdown2/addons/openvswitch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py index 0a124ba2..8ab086c8 100644 --- a/ifupdown2/addons/openvswitch.py +++ b/ifupdown2/addons/openvswitch.py @@ -157,7 +157,11 @@ def _addbridge (self, ifaceobj): cmd = "--may-exist add-br %s"%(iface) if ovsparent is not None and ovsoptions: - cmd = cmd + " %s" %(ovsoptions) + if ovsoptions.startswith(ovsparent): + # for backwards compatibility to previous bug in parent configuration + cmd = cmd + " %s" %(ovsoptions) + else: + cmd = cmd + " %s %s" %(ovsparent, ovsoptions) cmd_list.append(cmd)