From 88b785ee3424fb010da3e70c4337b3b5ebdf5f5e Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Thu, 24 Aug 2023 17:28:26 +0200 Subject: [PATCH] nm: do not attach ovs-bridge to itself when creating a profile If ovs-bridge and ovs-interface shares name and ovs-interface is modified, during the creation of the ovs-bridge profile we are setting itself as a controller. That is wrong and NetworkManager is reporting the following error: ``` libnmstate.error.NmstateLibnmError: Update profile uuid:ba206f8f-2ed6-486d-a339-9d1f62c5cb84 iface:br1 type:ovs-bridge failed with error=nm-connection-error-quark: connection.slave-type: Cannot set 'master' without 'slave-type' (6) ``` In order to solve that, before setting the controller we check that it is not itself. Signed-off-by: Fernando Fernandez Mancera --- libnmstate/nm/ovs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libnmstate/nm/ovs.py b/libnmstate/nm/ovs.py index f7c589b6..6f732207 100644 --- a/libnmstate/nm/ovs.py +++ b/libnmstate/nm/ovs.py @@ -375,5 +375,8 @@ def set_ovs_iface_controller_info(iface_infos): for iface_info in iface_infos: ctrl_name = pending_changes.get(iface_info[Interface.NAME]) - if ctrl_name: + if ctrl_name and not ( + ctrl_name == iface_info[Interface.NAME] + and iface_info[Interface.TYPE] == InterfaceType.OVS_BRIDGE + ): iface_info[Interface.CONTROLLER] = ctrl_name -- 2.41.0