1992bd
From e0dc628ac553072891fa6607dc91b652efd99be2 Mon Sep 17 00:00:00 2001
2b0ae0
From: Eduardo Otubo <otubo@redhat.com>
bb836b
Date: Fri, 7 May 2021 13:36:06 +0200
18322d
Subject: Do not write NM_CONTROLLED=no in generated interface config  files
18322d
2b0ae0
Conflicts 20.3:
2b0ae0
 - Not appplying patch on cloudinit/net/sysconfig.py since it now has a
2b0ae0
mechanism to identify if cloud-init is running on RHEL, having the
2b0ae0
correct settings for NM_CONTROLLED.
2b0ae0
18322d
X-downstream-only: true
2b0ae0
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
18322d
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
18322d
---
1992bd
 cloudinit/net/sysconfig.py  |  1 -
bb836b
 tests/unittests/test_net.py | 28 ----------------------------
1992bd
 2 files changed, 29 deletions(-)
18322d
18322d
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
1992bd
index ba85c4f6..e06ddee7 100644
18322d
--- a/cloudinit/net/sysconfig.py
18322d
+++ b/cloudinit/net/sysconfig.py
1992bd
@@ -336,7 +336,6 @@ class Renderer(renderer.Renderer):
1992bd
         "rhel": {
1992bd
             "ONBOOT": True,
1992bd
             "USERCTL": False,
1992bd
-            "NM_CONTROLLED": False,
1992bd
             "BOOTPROTO": "none",
1992bd
         },
1992bd
         "suse": {"BOOTPROTO": "static", "STARTMODE": "auto"},
18322d
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
1992bd
index 47e4ba00..591241b3 100644
18322d
--- a/tests/unittests/test_net.py
18322d
+++ b/tests/unittests/test_net.py
1992bd
@@ -579,7 +579,6 @@ GATEWAY=172.19.3.254
18322d
 HWADDR=fa:16:3e:ed:9a:59
18322d
 IPADDR=172.19.1.34
18322d
 NETMASK=255.255.252.0
18322d
-NM_CONTROLLED=no
18322d
 ONBOOT=yes
18322d
 TYPE=Ethernet
2b0ae0
 USERCTL=no
1992bd
@@ -712,7 +711,6 @@ IPADDR=172.19.1.34
18322d
 IPADDR1=10.0.0.10
18322d
 NETMASK=255.255.252.0
18322d
 NETMASK1=255.255.255.0
18322d
-NM_CONTROLLED=no
18322d
 ONBOOT=yes
18322d
 TYPE=Ethernet
2b0ae0
 USERCTL=no
1992bd
@@ -874,7 +872,6 @@ IPV6_AUTOCONF=no
18322d
 IPV6_DEFAULTGW=2001:DB8::1
bb836b
 IPV6_FORCE_ACCEPT_RA=no
18322d
 NETMASK=255.255.252.0
18322d
-NM_CONTROLLED=no
18322d
 ONBOOT=yes
18322d
 TYPE=Ethernet
2b0ae0
 USERCTL=no
1992bd
@@ -1053,7 +1050,6 @@ NETWORK_CONFIGS = {
18322d
                 BOOTPROTO=none
18322d
                 DEVICE=eth1
18322d
                 HWADDR=cf:d6:af:48:e8:80
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -1072,7 +1068,6 @@ NETWORK_CONFIGS = {
18322d
                 IPADDR=192.168.21.3
18322d
                 NETMASK=255.255.255.0
18322d
                 METRIC=10000
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -1244,7 +1239,6 @@ NETWORK_CONFIGS = {
bb836b
                 IPV6_AUTOCONF=no
bb836b
                 IPV6_FORCE_ACCEPT_RA=no
18322d
                 NETMASK=255.255.255.0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
2b0ae0
                 USERCTL=no
1992bd
@@ -2093,7 +2087,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 DHCPV6C=yes
18322d
                 IPV6INIT=yes
18322d
                 MACADDR=aa:bb:cc:dd:ee:ff
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Bond
1992bd
                 USERCTL=no"""
1992bd
@@ -2103,7 +2096,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 BOOTPROTO=dhcp
18322d
                 DEVICE=bond0.200
8a7340
                 DHCLIENT_SET_DEFAULT_ROUTE=no
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 PHYSDEV=bond0
bb836b
                 USERCTL=no
1992bd
@@ -2123,7 +2115,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 IPV6_DEFAULTGW=2001:4800:78ff:1b::1
18322d
                 MACADDR=bb:bb:bb:bb:bb:aa
18322d
                 NETMASK=255.255.255.0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 PRIO=22
2b0ae0
                 STP=no
1992bd
@@ -2135,7 +2126,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 BOOTPROTO=none
18322d
                 DEVICE=eth0
18322d
                 HWADDR=c0:d6:9f:2c:e8:80
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -2154,7 +2144,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 MTU=1500
18322d
                 NETMASK=255.255.255.0
18322d
                 NETMASK1=255.255.255.0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 PHYSDEV=eth0
bb836b
                 USERCTL=no
1992bd
@@ -2166,7 +2155,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 DEVICE=eth1
18322d
                 HWADDR=aa:d6:9f:2c:e8:80
18322d
                 MASTER=bond0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 SLAVE=yes
2b0ae0
                 TYPE=Ethernet
1992bd
@@ -2178,7 +2166,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 DEVICE=eth2
18322d
                 HWADDR=c0:bb:9f:2c:e8:80
18322d
                 MASTER=bond0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 SLAVE=yes
2b0ae0
                 TYPE=Ethernet
1992bd
@@ -2190,7 +2177,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 BRIDGE=br0
18322d
                 DEVICE=eth3
18322d
                 HWADDR=66:bb:9f:2c:e8:80
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -2201,7 +2187,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 BRIDGE=br0
18322d
                 DEVICE=eth4
18322d
                 HWADDR=98:bb:9f:2c:e8:80
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -2212,7 +2197,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
18322d
                 DEVICE=eth5
8a7340
                 DHCLIENT_SET_DEFAULT_ROUTE=no
18322d
                 HWADDR=98:bb:9f:2c:e8:8a
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=no
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -2689,7 +2673,6 @@ iface bond0 inet6 static
18322d
         MTU=9000
18322d
         NETMASK=255.255.255.0
18322d
         NETMASK1=255.255.255.0
18322d
-        NM_CONTROLLED=no
18322d
         ONBOOT=yes
18322d
         TYPE=Bond
2b0ae0
         USERCTL=no
1992bd
@@ -2701,7 +2684,6 @@ iface bond0 inet6 static
18322d
         DEVICE=bond0s0
18322d
         HWADDR=aa:bb:cc:dd:e8:00
18322d
         MASTER=bond0
18322d
-        NM_CONTROLLED=no
18322d
         ONBOOT=yes
18322d
         SLAVE=yes
2b0ae0
         TYPE=Ethernet
1992bd
@@ -2729,7 +2711,6 @@ iface bond0 inet6 static
18322d
         DEVICE=bond0s1
18322d
         HWADDR=aa:bb:cc:dd:e8:01
18322d
         MASTER=bond0
18322d
-        NM_CONTROLLED=no
18322d
         ONBOOT=yes
18322d
         SLAVE=yes
2b0ae0
         TYPE=Ethernet
1992bd
@@ -2794,7 +2775,6 @@ iface bond0 inet6 static
18322d
                 BOOTPROTO=none
18322d
                 DEVICE=en0
18322d
                 HWADDR=aa:bb:cc:dd:e8:00
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
1992bd
                 USERCTL=no"""
1992bd
@@ -2815,7 +2795,6 @@ iface bond0 inet6 static
18322d
                 MTU=2222
18322d
                 NETMASK=255.255.255.0
18322d
                 NETMASK1=255.255.255.0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 PHYSDEV=en0
bb836b
                 USERCTL=no
1992bd
@@ -2890,7 +2869,6 @@ iface bond0 inet6 static
18322d
                 DEVICE=br0
18322d
                 IPADDR=192.168.2.2
18322d
                 NETMASK=255.255.255.0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 PRIO=22
2b0ae0
                 STP=no
1992bd
@@ -3032,7 +3010,6 @@ iface bond0 inet6 static
18322d
                 HWADDR=52:54:00:12:34:00
18322d
                 IPADDR=192.168.1.2
18322d
                 NETMASK=255.255.255.0
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=no
18322d
                 TYPE=Ethernet
2b0ae0
                 USERCTL=no
1992bd
@@ -3044,7 +3021,6 @@ iface bond0 inet6 static
18322d
                 DEVICE=eth1
18322d
                 HWADDR=52:54:00:12:34:aa
18322d
                 MTU=1480
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=yes
18322d
                 TYPE=Ethernet
2b0ae0
                 USERCTL=no
1992bd
@@ -3055,7 +3031,6 @@ iface bond0 inet6 static
18322d
                 BOOTPROTO=none
18322d
                 DEVICE=eth2
18322d
                 HWADDR=52:54:00:12:34:ff
18322d
-                NM_CONTROLLED=no
18322d
                 ONBOOT=no
18322d
                 TYPE=Ethernet
2b0ae0
                 USERCTL=no
1992bd
@@ -3628,7 +3603,6 @@ class TestRhelSysConfigRendering(CiTestCase):
18322d
 BOOTPROTO=dhcp
18322d
 DEVICE=eth1000
8a7340
 HWADDR=07-1c-c6-75-a4-be
18322d
-NM_CONTROLLED=no
18322d
 ONBOOT=yes
18322d
 TYPE=Ethernet
2b0ae0
 USERCTL=no
1992bd
@@ -3840,7 +3814,6 @@ GATEWAY=10.0.2.2
18322d
 HWADDR=52:54:00:12:34:00
18322d
 IPADDR=10.0.2.15
18322d
 NETMASK=255.255.255.0
18322d
-NM_CONTROLLED=no
18322d
 ONBOOT=yes
18322d
 TYPE=Ethernet
2b0ae0
 USERCTL=no
1992bd
@@ -3910,7 +3883,6 @@ USERCTL=no
18322d
 #
18322d
 BOOTPROTO=dhcp
18322d
 DEVICE=eth0
18322d
-NM_CONTROLLED=no
18322d
 ONBOOT=yes
18322d
 TYPE=Ethernet
2b0ae0
 USERCTL=no
18322d
-- 
1992bd
2.31.1
18322d