summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-18 18:30:19 +0100
committerThomas Haller <thaller@redhat.com>2020-09-08 12:35:03 +0200
commitfb3e0a696205285b80ee05b7bec32a3d179c7bf6 (patch)
tree135f96d32c8c1ff925d640d0de8b75f83b1cb9a2
parent7f634063ba974734769617f22a1849b2285a4489 (diff)
downloadNetworkManager-fb3e0a696205285b80ee05b7bec32a3d179c7bf6.tar.gz
ifcfg: fix writer when changing OVS slave to clear previous settings
We need to reset the OVS_PORT and OVS_PORT_UUID variables. Otherwise, clearing the slave type doesn't work. On master this is solved differently, by automatically clearing all variables that are not explicitly set. Reproducer: nmcli con del t-eth1 nmcli con add type ethernet autoconnect no ifname eth1 master port0 con-name t-eth1 slave-type ovs-port echo " remove ovs-interface remove connection.master remove connection.slave-type print save quit " | nmcli c edit t-eth1 nmcli con show t-eth1 | grep 'ovs\|slave-type' Fixes: 1440fe6a8804 ('ifcfg: don't forget master of ovs interfaces') https://bugzilla.redhat.com/show_bug.cgi?id=1804167 (cherry picked from commit 0c8046574e782ca926d265348d10866f1653aef1)
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
index f6e12633db..ea8be3a039 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
@@ -1948,6 +1948,8 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
svSetValueStr (ifcfg, "BRIDGE", NULL);
svSetValueStr (ifcfg, "TEAM_MASTER_UUID", NULL);
svSetValueStr (ifcfg, "TEAM_MASTER", NULL);
+ svSetValueStr (ifcfg, "OVS_PORT_UUID", NULL);
+ svSetValueStr (ifcfg, "OVS_PORT", NULL);
master = nm_setting_connection_get_master (s_con);
if (master) {