Blame SOURCES/1000-ifcfg-fix-writer-rh1804167.patch

245932
From ff9c477f3238aeca9b8ca2e0805d419a449ea4d9 Mon Sep 17 00:00:00 2001
245932
From: Thomas Haller <thaller@redhat.com>
245932
Date: Tue, 18 Feb 2020 18:30:19 +0100
245932
Subject: [PATCH] ifcfg: fix writer when changing OVS slave to clear previous
245932
 settings
245932
245932
We need to reset the OVS_PORT and OVS_PORT_UUID variables.
245932
Otherwise, clearing the slave type doesn't work.
245932
245932
On master this is solved differently, by automatically clearing all
245932
variables that are not explicitly set.
245932
245932
Reproducer:
245932
245932
    nmcli con del t-eth1
245932
    nmcli con add type ethernet autoconnect no ifname eth1 master port0 con-name t-eth1 slave-type ovs-port
245932
    echo "
245932
    remove ovs-interface
245932
    remove connection.master
245932
    remove connection.slave-type
245932
    print
245932
    save
245932
    quit
245932
    " | nmcli c edit t-eth1
245932
    nmcli con show t-eth1 | grep 'ovs\|slave-type'
245932
245932
Fixes: 1440fe6a8804 ('ifcfg: don't forget master of ovs interfaces')
245932
245932
https://bugzilla.redhat.com/show_bug.cgi?id=1804167
245932
(cherry picked from commit 0c8046574e782ca926d265348d10866f1653aef1)
245932
---
245932
 src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 2 ++
245932
 1 file changed, 2 insertions(+)
245932
245932
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
245932
index f328cc8f0..90a1a2b8f 100644
245932
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
245932
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c
245932
@@ -1923,6 +1923,8 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
245932
 	svSetValueStr (ifcfg, "BRIDGE", NULL);
245932
 	svSetValueStr (ifcfg, "TEAM_MASTER_UUID", NULL);
245932
 	svSetValueStr (ifcfg, "TEAM_MASTER", NULL);
245932
+	svSetValueStr (ifcfg, "OVS_PORT_UUID", NULL);
245932
+	svSetValueStr (ifcfg, "OVS_PORT", NULL);
245932
 
245932
 	master = nm_setting_connection_get_master (s_con);
245932
 	if (master) {
245932
-- 
245932
2.24.1
245932