Update to 20.4

This is the first step for rebasing cloud-init to 21.3. All patches are
rebased, old patches that are already on the release were deleted.

Signed-off-by: Eduardo Otubo <otubo@redhat.com>
This commit is contained in:
Eduardo Otubo 2021-09-02 09:44:25 +02:00
parent d614fa1697
commit f3523f3923
9 changed files with 81 additions and 234 deletions

View File

@ -1,33 +0,0 @@
From 950c186a7e0c66a3ed84ea97291e5829ca3d826c Mon Sep 17 00:00:00 2001
From: James Falcon <TheRealFalcon@users.noreply.github.com>
Date: Tue, 15 Jun 2021 15:25:37 -0500
Subject: [PATCH] Replace deprecated collections.Iterable with abc replacement
(#922)
LP: #1932048
---
cloudinit/log.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 2e5df04217..1014990773 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -8,7 +8,7 @@
#
# This file is part of cloud-init. See LICENSE file for license information.
-import collections
+import collections.abc
import io
import logging
import logging.config
@@ -78,7 +78,7 @@ def setupLogging(cfg=None):
for a_cfg in cfg['log_cfgs']:
if isinstance(a_cfg, str):
log_cfgs.append(a_cfg)
- elif isinstance(a_cfg, (collections.Iterable)):
+ elif isinstance(a_cfg, (collections.abc.Iterable)):
cfg_str = [str(c) for c in a_cfg]
log_cfgs.append('\n'.join(cfg_str))
else:

View File

@ -1,69 +0,0 @@
From 9a4c22ac0b660cd2573b9a88d14a0ef39b61afca Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo@redhat.com>
Date: Wed, 3 Feb 2021 10:28:49 +0100
Subject: [PATCH] Revert "ssh_util: handle non-default AuthorizedKeysFile
config (#586)" (#775)
This reverts commit b0e73814db4027dba0b7dc0282e295b7f653325c.
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
---
cloudinit/ssh_util.py | 6 +++---
tests/unittests/test_sshutil.py | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/cloudinit/ssh_util.py b/cloudinit/ssh_util.py
index d5113996..c08042d6 100644
--- a/cloudinit/ssh_util.py
+++ b/cloudinit/ssh_util.py
@@ -262,13 +262,13 @@ def extract_authorized_keys(username, sshd_cfg_file=DEF_SSHD_CFG):
except (IOError, OSError):
# Give up and use a default key filename
- auth_key_fns.append(default_authorizedkeys_file)
+ auth_key_fns[0] = default_authorizedkeys_file
util.logexc(LOG, "Failed extracting 'AuthorizedKeysFile' in SSH "
"config from %r, using 'AuthorizedKeysFile' file "
"%r instead", DEF_SSHD_CFG, auth_key_fns[0])
- # always store all the keys in the first file configured on sshd_config
- return (auth_key_fns[0], parse_authorized_keys(auth_key_fns))
+ # always store all the keys in the user's private file
+ return (default_authorizedkeys_file, parse_authorized_keys(auth_key_fns))
def setup_user_keys(keys, username, options=None):
diff --git a/tests/unittests/test_sshutil.py b/tests/unittests/test_sshutil.py
index 88a111e3..fd1d1bac 100644
--- a/tests/unittests/test_sshutil.py
+++ b/tests/unittests/test_sshutil.py
@@ -593,7 +593,7 @@ class TestMultipleSshAuthorizedKeysFile(test_helpers.CiTestCase):
fpw.pw_name, sshd_config)
content = ssh_util.update_authorized_keys(auth_key_entries, [])
- self.assertEqual(authorized_keys, auth_key_fn)
+ self.assertEqual("%s/.ssh/authorized_keys" % fpw.pw_dir, auth_key_fn)
self.assertTrue(VALID_CONTENT['rsa'] in content)
self.assertTrue(VALID_CONTENT['dsa'] in content)
@@ -610,7 +610,7 @@ class TestMultipleSshAuthorizedKeysFile(test_helpers.CiTestCase):
sshd_config = self.tmp_path('sshd_config')
util.write_file(
sshd_config,
- "AuthorizedKeysFile %s %s" % (user_keys, authorized_keys)
+ "AuthorizedKeysFile %s %s" % (authorized_keys, user_keys)
)
(auth_key_fn, auth_key_entries) = ssh_util.extract_authorized_keys(
@@ -618,7 +618,7 @@ class TestMultipleSshAuthorizedKeysFile(test_helpers.CiTestCase):
)
content = ssh_util.update_authorized_keys(auth_key_entries, [])
- self.assertEqual(user_keys, auth_key_fn)
+ self.assertEqual("%s/.ssh/authorized_keys" % fpw.pw_dir, auth_key_fn)
self.assertTrue(VALID_CONTENT['rsa'] in content)
self.assertTrue(VALID_CONTENT['dsa'] in content)
--
2.27.0

View File

@ -1,46 +0,0 @@
From f16b18607444cb41e263edfa7fb0c97ba1f7e518 Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo@redhat.com>
Date: Fri, 4 Dec 2020 11:05:08 +0100
Subject: [PATCH] Sandbox ca_certs tests to avoid failure
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
---
.../unittests/test_handler/test_handler_ca_certs.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tests/unittests/test_handler/test_handler_ca_certs.py b/tests/unittests/test_handler/test_handler_ca_certs.py
index e74a0a08..a16430d5 100644
--- a/tests/unittests/test_handler/test_handler_ca_certs.py
+++ b/tests/unittests/test_handler/test_handler_ca_certs.py
@@ -152,6 +152,7 @@ class TestAddCaCerts(TestCase):
self.paths = helpers.Paths({
'cloud_dir': tmpdir,
})
+ self.add_patch("cloudinit.config.cc_ca_certs.os.stat", "m_stat")
def test_no_certs_in_list(self):
"""Test that no certificate are written if not provided."""
@@ -215,17 +216,12 @@ class TestAddCaCerts(TestCase):
expected = "cloud-init-ca-certs.crt\n"
- with ExitStack() as mocks:
- mock_write = mocks.enter_context(
- mock.patch.object(util, 'write_file', autospec=True))
- mock_stat = mocks.enter_context(
- mock.patch("cloudinit.config.cc_ca_certs.os.stat")
- )
- mock_stat.return_value.st_size = 0
+ with mock.patch.object(util, 'write_file', autospec=True) as m_write:
+ self.m_stat.return_value.st_size = 0
cc_ca_certs.add_ca_certs([cert])
- mock_write.assert_has_calls([
+ m_write.assert_has_calls([
mock.call("/usr/share/ca-certificates/cloud-init-ca-certs.crt",
cert, mode=0o644),
mock.call("/etc/ca-certificates.conf", expected, omode="wb")])
--
2.27.0

View File

@ -1,7 +1,7 @@
From 8256852de570a0c6b237c75abd134ddbafee5c1f Mon Sep 17 00:00:00 2001 From 8caf88512cf2c558e55e78b82c27809f5061e2da Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo@redhat.com> From: Eduardo Otubo <otubo@redhat.com>
Date: Thu, 3 Dec 2020 12:31:50 +0100 Date: Thu, 2 Sep 2021 11:22:14 +0200
Subject: [PATCH] Do not write NM_CONTROLLED=no in generated interface config Subject: [PATCH] Do not write NM_CONTROLLED=no in generated interface config
files files
Conflicts 20.3: Conflicts 20.3:
@ -19,10 +19,10 @@ Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
3 files changed, 1 insertion(+), 58 deletions(-) 3 files changed, 1 insertion(+), 58 deletions(-)
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index a930e612..9c822c3e 100644 index 06f7255e..ccbd785a 100644
--- a/cloudinit/net/sysconfig.py --- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py
@@ -289,7 +289,7 @@ class Renderer(renderer.Renderer): @@ -290,7 +290,7 @@ class Renderer(renderer.Renderer):
# details about this) # details about this)
iface_defaults = { iface_defaults = {
@ -32,10 +32,10 @@ index a930e612..9c822c3e 100644
'suse': {'BOOTPROTO': 'static', 'STARTMODE': 'auto'}, 'suse': {'BOOTPROTO': 'static', 'STARTMODE': 'auto'},
} }
diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py
index a1df066a..bc167f94 100644 index d09e46af..3f01c99e 100644
--- a/tests/unittests/test_distros/test_netconfig.py --- a/tests/unittests/test_distros/test_netconfig.py
+++ b/tests/unittests/test_distros/test_netconfig.py +++ b/tests/unittests/test_distros/test_netconfig.py
@@ -484,7 +484,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -503,7 +503,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
GATEWAY=192.168.1.254 GATEWAY=192.168.1.254
IPADDR=192.168.1.5 IPADDR=192.168.1.5
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -43,7 +43,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -492,7 +491,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -511,7 +510,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
self.ifcfg_path('eth1'): dedent("""\ self.ifcfg_path('eth1'): dedent("""\
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=eth1 DEVICE=eth1
@ -51,7 +51,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -517,7 +515,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -536,7 +534,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
IPV6_AUTOCONF=no IPV6_AUTOCONF=no
IPV6_DEFAULTGW=2607:f0d0:1002:0011::1 IPV6_DEFAULTGW=2607:f0d0:1002:0011::1
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
@ -59,7 +59,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -525,7 +522,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -544,7 +541,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
self.ifcfg_path('eth1'): dedent("""\ self.ifcfg_path('eth1'): dedent("""\
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=eth1 DEVICE=eth1
@ -67,7 +67,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -559,7 +555,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -578,7 +574,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
HWADDR=00:16:3e:60:7c:df HWADDR=00:16:3e:60:7c:df
IPADDR=192.10.1.2 IPADDR=192.10.1.2
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -75,7 +75,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -569,7 +564,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -588,7 +583,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
DEVICE=infra0 DEVICE=infra0
IPADDR=10.0.1.2 IPADDR=10.0.1.2
NETMASK=255.255.0.0 NETMASK=255.255.0.0
@ -83,7 +83,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
PHYSDEV=eth0 PHYSDEV=eth0
USERCTL=no USERCTL=no
@@ -598,7 +592,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -617,7 +611,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
DEVICE=eth0 DEVICE=eth0
IPADDR=192.10.1.2 IPADDR=192.10.1.2
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -91,7 +91,7 @@ index a1df066a..bc167f94 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -608,7 +601,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase): @@ -627,7 +620,6 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
DEVICE=eth0.1001 DEVICE=eth0.1001
IPADDR=10.0.1.2 IPADDR=10.0.1.2
NETMASK=255.255.0.0 NETMASK=255.255.0.0
@ -100,7 +100,7 @@ index a1df066a..bc167f94 100644
PHYSDEV=eth0 PHYSDEV=eth0
USERCTL=no USERCTL=no
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index 70453683..47a71964 100644 index fc77b11e..3e35ff4d 100644
--- a/tests/unittests/test_net.py --- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py +++ b/tests/unittests/test_net.py
@@ -535,7 +535,6 @@ GATEWAY=172.19.3.254 @@ -535,7 +535,6 @@ GATEWAY=172.19.3.254
@ -127,7 +127,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -884,7 +881,6 @@ NETWORK_CONFIGS = { @@ -910,7 +907,6 @@ NETWORK_CONFIGS = {
BOOTPROTO=none BOOTPROTO=none
DEVICE=eth1 DEVICE=eth1
HWADDR=cf:d6:af:48:e8:80 HWADDR=cf:d6:af:48:e8:80
@ -135,7 +135,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -901,7 +897,6 @@ NETWORK_CONFIGS = { @@ -927,7 +923,6 @@ NETWORK_CONFIGS = {
IPADDR=192.168.21.3 IPADDR=192.168.21.3
NETMASK=255.255.255.0 NETMASK=255.255.255.0
METRIC=10000 METRIC=10000
@ -143,7 +143,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -1032,7 +1027,6 @@ NETWORK_CONFIGS = { @@ -1075,7 +1070,6 @@ NETWORK_CONFIGS = {
IPV6_AUTOCONF=no IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -151,7 +151,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1095,7 +1089,6 @@ NETWORK_CONFIGS = { @@ -1144,7 +1138,6 @@ NETWORK_CONFIGS = {
DHCPV6C=yes DHCPV6C=yes
IPV6INIT=yes IPV6INIT=yes
DEVICE=iface0 DEVICE=iface0
@ -159,7 +159,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1150,7 +1143,6 @@ NETWORK_CONFIGS = { @@ -1199,7 +1192,6 @@ NETWORK_CONFIGS = {
IPV6INIT=yes IPV6INIT=yes
IPV6_FORCE_ACCEPT_RA=yes IPV6_FORCE_ACCEPT_RA=yes
DEVICE=iface0 DEVICE=iface0
@ -167,7 +167,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1205,7 +1197,6 @@ NETWORK_CONFIGS = { @@ -1254,7 +1246,6 @@ NETWORK_CONFIGS = {
IPV6INIT=yes IPV6INIT=yes
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
DEVICE=iface0 DEVICE=iface0
@ -175,7 +175,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1250,7 +1241,6 @@ NETWORK_CONFIGS = { @@ -1299,7 +1290,6 @@ NETWORK_CONFIGS = {
IPV6_AUTOCONF=yes IPV6_AUTOCONF=yes
IPV6INIT=yes IPV6INIT=yes
DEVICE=iface0 DEVICE=iface0
@ -183,7 +183,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1277,7 +1267,6 @@ NETWORK_CONFIGS = { @@ -1326,7 +1316,6 @@ NETWORK_CONFIGS = {
IPV6_AUTOCONF=no IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
DEVICE=iface0 DEVICE=iface0
@ -191,7 +191,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1324,7 +1313,6 @@ NETWORK_CONFIGS = { @@ -1373,7 +1362,6 @@ NETWORK_CONFIGS = {
IPV6_AUTOCONF=yes IPV6_AUTOCONF=yes
IPV6INIT=yes IPV6INIT=yes
DEVICE=iface0 DEVICE=iface0
@ -199,15 +199,15 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1371,7 +1359,6 @@ NETWORK_CONFIGS = { @@ -1421,7 +1409,6 @@ NETWORK_CONFIGS = {
IPV6INIT=yes IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=yes IPV6_FORCE_ACCEPT_RA=yes
DEVICE=iface0 DEVICE=iface0
- NM_CONTROLLED=no - NM_CONTROLLED=no
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1404,7 +1391,6 @@ NETWORK_CONFIGS = { @@ -1454,7 +1441,6 @@ NETWORK_CONFIGS = {
'ifcfg-iface0': textwrap.dedent("""\ 'ifcfg-iface0': textwrap.dedent("""\
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=iface0 DEVICE=iface0
@ -215,7 +215,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1447,7 +1433,6 @@ NETWORK_CONFIGS = { @@ -1497,7 +1483,6 @@ NETWORK_CONFIGS = {
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=iface0 DEVICE=iface0
ETHTOOL_OPTS="wol g" ETHTOOL_OPTS="wol g"
@ -223,7 +223,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -1736,7 +1721,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1786,7 +1771,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
DHCPV6C=yes DHCPV6C=yes
IPV6INIT=yes IPV6INIT=yes
MACADDR=aa:bb:cc:dd:ee:ff MACADDR=aa:bb:cc:dd:ee:ff
@ -231,7 +231,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Bond TYPE=Bond
USERCTL=no"""), USERCTL=no"""),
@@ -1744,7 +1728,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1794,7 +1778,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=bond0.200 DEVICE=bond0.200
DHCLIENT_SET_DEFAULT_ROUTE=no DHCLIENT_SET_DEFAULT_ROUTE=no
@ -239,7 +239,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
PHYSDEV=bond0 PHYSDEV=bond0
USERCTL=no USERCTL=no
@@ -1762,7 +1745,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1812,7 +1795,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
IPV6_DEFAULTGW=2001:4800:78ff:1b::1 IPV6_DEFAULTGW=2001:4800:78ff:1b::1
MACADDR=bb:bb:bb:bb:bb:aa MACADDR=bb:bb:bb:bb:bb:aa
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -247,7 +247,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
PRIO=22 PRIO=22
STP=no STP=no
@@ -1772,7 +1754,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1822,7 +1804,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
BOOTPROTO=none BOOTPROTO=none
DEVICE=eth0 DEVICE=eth0
HWADDR=c0:d6:9f:2c:e8:80 HWADDR=c0:d6:9f:2c:e8:80
@ -255,7 +255,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -1789,7 +1770,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1839,7 +1820,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
MTU=1500 MTU=1500
NETMASK=255.255.255.0 NETMASK=255.255.255.0
NETMASK1=255.255.255.0 NETMASK1=255.255.255.0
@ -263,7 +263,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
PHYSDEV=eth0 PHYSDEV=eth0
USERCTL=no USERCTL=no
@@ -1799,7 +1779,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1849,7 +1829,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
DEVICE=eth1 DEVICE=eth1
HWADDR=aa:d6:9f:2c:e8:80 HWADDR=aa:d6:9f:2c:e8:80
MASTER=bond0 MASTER=bond0
@ -271,7 +271,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
SLAVE=yes SLAVE=yes
TYPE=Ethernet TYPE=Ethernet
@@ -1809,7 +1788,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1859,7 +1838,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
DEVICE=eth2 DEVICE=eth2
HWADDR=c0:bb:9f:2c:e8:80 HWADDR=c0:bb:9f:2c:e8:80
MASTER=bond0 MASTER=bond0
@ -279,7 +279,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
SLAVE=yes SLAVE=yes
TYPE=Ethernet TYPE=Ethernet
@@ -1819,7 +1797,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1869,7 +1847,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
BRIDGE=br0 BRIDGE=br0
DEVICE=eth3 DEVICE=eth3
HWADDR=66:bb:9f:2c:e8:80 HWADDR=66:bb:9f:2c:e8:80
@ -287,7 +287,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -1828,7 +1805,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1878,7 +1855,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
BRIDGE=br0 BRIDGE=br0
DEVICE=eth4 DEVICE=eth4
HWADDR=98:bb:9f:2c:e8:80 HWADDR=98:bb:9f:2c:e8:80
@ -295,7 +295,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -1837,7 +1813,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1887,7 +1863,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
DEVICE=eth5 DEVICE=eth5
DHCLIENT_SET_DEFAULT_ROUTE=no DHCLIENT_SET_DEFAULT_ROUTE=no
HWADDR=98:bb:9f:2c:e8:8a HWADDR=98:bb:9f:2c:e8:8a
@ -303,7 +303,7 @@ index 70453683..47a71964 100644
ONBOOT=no ONBOOT=no
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -1848,7 +1823,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true @@ -1898,7 +1873,6 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
IPADDR=192.168.200.7 IPADDR=192.168.200.7
MTU=9000 MTU=9000
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -311,7 +311,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=InfiniBand TYPE=InfiniBand
USERCTL=no"""), USERCTL=no"""),
@@ -2293,7 +2267,6 @@ iface bond0 inet6 static @@ -2343,7 +2317,6 @@ iface bond0 inet6 static
MTU=9000 MTU=9000
NETMASK=255.255.255.0 NETMASK=255.255.255.0
NETMASK1=255.255.255.0 NETMASK1=255.255.255.0
@ -319,7 +319,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Bond TYPE=Bond
USERCTL=no USERCTL=no
@@ -2303,7 +2276,6 @@ iface bond0 inet6 static @@ -2353,7 +2326,6 @@ iface bond0 inet6 static
DEVICE=bond0s0 DEVICE=bond0s0
HWADDR=aa:bb:cc:dd:e8:00 HWADDR=aa:bb:cc:dd:e8:00
MASTER=bond0 MASTER=bond0
@ -327,7 +327,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
SLAVE=yes SLAVE=yes
TYPE=Ethernet TYPE=Ethernet
@@ -2325,7 +2297,6 @@ iface bond0 inet6 static @@ -2375,7 +2347,6 @@ iface bond0 inet6 static
DEVICE=bond0s1 DEVICE=bond0s1
HWADDR=aa:bb:cc:dd:e8:01 HWADDR=aa:bb:cc:dd:e8:01
MASTER=bond0 MASTER=bond0
@ -335,7 +335,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
SLAVE=yes SLAVE=yes
TYPE=Ethernet TYPE=Ethernet
@@ -2382,7 +2353,6 @@ iface bond0 inet6 static @@ -2432,7 +2403,6 @@ iface bond0 inet6 static
BOOTPROTO=none BOOTPROTO=none
DEVICE=en0 DEVICE=en0
HWADDR=aa:bb:cc:dd:e8:00 HWADDR=aa:bb:cc:dd:e8:00
@ -343,7 +343,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no"""), USERCTL=no"""),
@@ -2401,7 +2371,6 @@ iface bond0 inet6 static @@ -2451,7 +2421,6 @@ iface bond0 inet6 static
MTU=2222 MTU=2222
NETMASK=255.255.255.0 NETMASK=255.255.255.0
NETMASK1=255.255.255.0 NETMASK1=255.255.255.0
@ -351,7 +351,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
PHYSDEV=en0 PHYSDEV=en0
USERCTL=no USERCTL=no
@@ -2466,7 +2435,6 @@ iface bond0 inet6 static @@ -2516,7 +2485,6 @@ iface bond0 inet6 static
DEVICE=br0 DEVICE=br0
IPADDR=192.168.2.2 IPADDR=192.168.2.2
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -359,7 +359,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
PRIO=22 PRIO=22
STP=no STP=no
@@ -2482,7 +2450,6 @@ iface bond0 inet6 static @@ -2532,7 +2500,6 @@ iface bond0 inet6 static
IPV6INIT=yes IPV6INIT=yes
IPV6_AUTOCONF=no IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
@ -367,7 +367,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -2496,7 +2463,6 @@ iface bond0 inet6 static @@ -2546,7 +2513,6 @@ iface bond0 inet6 static
IPV6INIT=yes IPV6INIT=yes
IPV6_AUTOCONF=no IPV6_AUTOCONF=no
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
@ -375,7 +375,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -2590,7 +2556,6 @@ iface bond0 inet6 static @@ -2640,7 +2606,6 @@ iface bond0 inet6 static
HWADDR=52:54:00:12:34:00 HWADDR=52:54:00:12:34:00
IPADDR=192.168.1.2 IPADDR=192.168.1.2
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -383,7 +383,7 @@ index 70453683..47a71964 100644
ONBOOT=no ONBOOT=no
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -2600,7 +2565,6 @@ iface bond0 inet6 static @@ -2650,7 +2615,6 @@ iface bond0 inet6 static
DEVICE=eth1 DEVICE=eth1
HWADDR=52:54:00:12:34:aa HWADDR=52:54:00:12:34:aa
MTU=1480 MTU=1480
@ -391,7 +391,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -2609,7 +2573,6 @@ iface bond0 inet6 static @@ -2659,7 +2623,6 @@ iface bond0 inet6 static
BOOTPROTO=none BOOTPROTO=none
DEVICE=eth2 DEVICE=eth2
HWADDR=52:54:00:12:34:ff HWADDR=52:54:00:12:34:ff
@ -399,7 +399,7 @@ index 70453683..47a71964 100644
ONBOOT=no ONBOOT=no
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3026,7 +2989,6 @@ class TestRhelSysConfigRendering(CiTestCase): @@ -3080,7 +3043,6 @@ class TestRhelSysConfigRendering(CiTestCase):
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=eth1000 DEVICE=eth1000
HWADDR=07-1c-c6-75-a4-be HWADDR=07-1c-c6-75-a4-be
@ -407,7 +407,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3147,7 +3109,6 @@ GATEWAY=10.0.2.2 @@ -3201,7 +3163,6 @@ GATEWAY=10.0.2.2
HWADDR=52:54:00:12:34:00 HWADDR=52:54:00:12:34:00
IPADDR=10.0.2.15 IPADDR=10.0.2.15
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -415,7 +415,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3178,7 +3139,6 @@ HWADDR=fa:16:3e:25:b4:59 @@ -3232,7 +3193,6 @@ HWADDR=fa:16:3e:25:b4:59
IPADDR=51.68.89.122 IPADDR=51.68.89.122
MTU=1500 MTU=1500
NETMASK=255.255.240.0 NETMASK=255.255.240.0
@ -423,7 +423,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3192,7 +3152,6 @@ DEVICE=eth1 @@ -3246,7 +3206,6 @@ DEVICE=eth1
DHCLIENT_SET_DEFAULT_ROUTE=no DHCLIENT_SET_DEFAULT_ROUTE=no
HWADDR=fa:16:3e:b1:ca:29 HWADDR=fa:16:3e:b1:ca:29
MTU=9000 MTU=9000
@ -431,7 +431,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3217,7 +3176,6 @@ USERCTL=no @@ -3271,7 +3230,6 @@ USERCTL=no
# #
BOOTPROTO=dhcp BOOTPROTO=dhcp
DEVICE=eth0 DEVICE=eth0
@ -439,7 +439,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3492,7 +3450,6 @@ USERCTL=no @@ -3546,7 +3504,6 @@ USERCTL=no
IPV6_FORCE_ACCEPT_RA=no IPV6_FORCE_ACCEPT_RA=no
IPV6_DEFAULTGW=2001:db8::1 IPV6_DEFAULTGW=2001:db8::1
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -447,7 +447,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3517,7 +3474,6 @@ USERCTL=no @@ -3571,7 +3528,6 @@ USERCTL=no
'ifcfg-eno1': textwrap.dedent("""\ 'ifcfg-eno1': textwrap.dedent("""\
BOOTPROTO=none BOOTPROTO=none
DEVICE=eno1 DEVICE=eno1
@ -455,7 +455,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Ethernet TYPE=Ethernet
USERCTL=no USERCTL=no
@@ -3528,7 +3484,6 @@ USERCTL=no @@ -3582,7 +3538,6 @@ USERCTL=no
IPADDR=192.6.1.9 IPADDR=192.6.1.9
MTU=1495 MTU=1495
NETMASK=255.255.255.0 NETMASK=255.255.255.0
@ -463,7 +463,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
PHYSDEV=eno1 PHYSDEV=eno1
USERCTL=no USERCTL=no
@@ -3558,7 +3513,6 @@ USERCTL=no @@ -3612,7 +3567,6 @@ USERCTL=no
IPADDR=10.101.8.65 IPADDR=10.101.8.65
MTU=1334 MTU=1334
NETMASK=255.255.255.192 NETMASK=255.255.255.192
@ -471,7 +471,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
TYPE=Bond TYPE=Bond
USERCTL=no USERCTL=no
@@ -3568,7 +3522,6 @@ USERCTL=no @@ -3622,7 +3576,6 @@ USERCTL=no
BOOTPROTO=none BOOTPROTO=none
DEVICE=enp0s0 DEVICE=enp0s0
MASTER=bond0 MASTER=bond0
@ -479,7 +479,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
SLAVE=yes SLAVE=yes
TYPE=Bond TYPE=Bond
@@ -3579,7 +3532,6 @@ USERCTL=no @@ -3633,7 +3586,6 @@ USERCTL=no
BOOTPROTO=none BOOTPROTO=none
DEVICE=enp0s1 DEVICE=enp0s1
MASTER=bond0 MASTER=bond0
@ -487,7 +487,7 @@ index 70453683..47a71964 100644
ONBOOT=yes ONBOOT=yes
SLAVE=yes SLAVE=yes
TYPE=Bond TYPE=Bond
@@ -3603,7 +3555,6 @@ USERCTL=no @@ -3657,7 +3609,6 @@ USERCTL=no
DEVICE=eno1 DEVICE=eno1
HWADDR=07-1c-c6-75-a4-be HWADDR=07-1c-c6-75-a4-be
METRIC=100 METRIC=100

View File

@ -1,7 +1,7 @@
From 5514d5922cbc92278868bfea587c4207619d81fc Mon Sep 17 00:00:00 2001 From 1a2b2cf55115a15244b9a7786959415f9fe421f9 Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo@redhat.com> From: Eduardo Otubo <otubo@redhat.com>
Date: Thu, 3 Dec 2020 12:34:01 +0100 Date: Thu, 2 Sep 2021 10:36:28 +0200
Subject: [PATCH 3/3] Don't override default network configuration Subject: [PATCH] Don't override default network configuration
Signed-off-by: Eduardo Otubo <otubo@redhat.com> Signed-off-by: Eduardo Otubo <otubo@redhat.com>
--- ---
@ -9,10 +9,10 @@ Signed-off-by: Eduardo Otubo <otubo@redhat.com>
1 file changed, 11 insertions(+), 1 deletion(-) 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index 9c822c3e..a240f65e 100644 index 06f7255e..bbe22d3d 100644
--- a/cloudinit/net/sysconfig.py --- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py
@@ -918,7 +918,17 @@ class Renderer(renderer.Renderer): @@ -940,7 +940,17 @@ class Renderer(renderer.Renderer):
# Distros configuring /etc/sysconfig/network as a file e.g. Centos # Distros configuring /etc/sysconfig/network as a file e.g. Centos
if sysconfig_path.endswith('network'): if sysconfig_path.endswith('network'):
util.ensure_dir(os.path.dirname(sysconfig_path)) util.ensure_dir(os.path.dirname(sysconfig_path))

View File

@ -1,6 +1,6 @@
Name: cloud-init Name: cloud-init
Version: 20.4 Version: 21.3
Release: 7%{?dist} Release: 1%{?dist}
Summary: Cloud instance init scripts Summary: Cloud instance init scripts
License: ASL 2.0 or GPLv3 License: ASL 2.0 or GPLv3
URL: http://launchpad.net/cloud-init URL: http://launchpad.net/cloud-init
@ -9,30 +9,18 @@ Source0: https://launchpad.net/cloud-init/trunk/%{version}/+download/%{na
Source1: cloud-init-tmpfiles.conf Source1: cloud-init-tmpfiles.conf
# Disable tests that require pylxd, which we don't have on Fedora # Disable tests that require pylxd, which we don't have on Fedora
Patch1: cloud-init-20.4-disable-lxd-tests.patch Patch1: cloud-init-21.3-disable-lxd-tests.patch
# Do not write NM_CONTROLLED=no in generated interface config files # Do not write NM_CONTROLLED=no in generated interface config files
# https://bugzilla.redhat.com/show_bug.cgi?id=1385172 # https://bugzilla.redhat.com/show_bug.cgi?id=1385172
Patch2: cloud-init-20.4-nm-controlled.patch Patch2: cloud-init-21.3-nm-controlled.patch
# Keep old properties in /etc/sysconfig/network # Keep old properties in /etc/sysconfig/network
# https://bugzilla.redhat.com/show_bug.cgi?id=1558641 # https://bugzilla.redhat.com/show_bug.cgi?id=1558641
Patch3: cloud-init-20.4-no-override-default-network.patch Patch3: cloud-init-21.3-no-override-default-network.patch
# ca_cert tests are failing because Fedora doesn't include those files
# by default. This will be upstream soon and we can drop this patch, or
# replace by its backport. For now I'll leave this here so the koji ci don't
# fail
Patch4: cloud-init-20.4-sandbox-ca_certs-tests-to-avoid-failure.patch
# Adding default RHEL configuration file # Adding default RHEL configuration file
Patch5: cloud-init-20.4-Adding-RHEL-default-cloud.cfg.patch Patch4: cloud-init-21.3-Adding-RHEL-default-cloud.cfg.patch
# Reverting commit b0e73814
Patch6: cloud-init-20.4-Revert-ssh_util-handle-non-default-AuthorizedKeysFil.patch
# Fix collections import to work with Python 3.10
Patch7: cloud-init-20.4-Fix-collections-python-310.patch
BuildArch: noarch BuildArch: noarch
@ -62,6 +50,7 @@ BuildRequires: python3-pyserial
BuildRequires: python3-PyYAML BuildRequires: python3-PyYAML
BuildRequires: python3-requests BuildRequires: python3-requests
BuildRequires: python3-six BuildRequires: python3-six
BuildRequires: python3-netifaces
# dnf is needed to make cc_ntp unit tests work # dnf is needed to make cc_ntp unit tests work
# https://bugs.launchpad.net/cloud-init/+bug/1721573 # https://bugs.launchpad.net/cloud-init/+bug/1721573
BuildRequires: /usr/bin/dnf BuildRequires: /usr/bin/dnf
@ -174,6 +163,9 @@ python3 -m pytest tests/unittests
%{_unitdir}/cloud-config.target %{_unitdir}/cloud-config.target
%{_unitdir}/cloud-init.target %{_unitdir}/cloud-init.target
/usr/lib/systemd/system-generators/cloud-init-generator /usr/lib/systemd/system-generators/cloud-init-generator
/lib/udev/rules.d/10-cloud-init-hook-hotplug.rules
/usr/lib/systemd/system/cloud-init-hotplugd.service
/usr/lib/systemd/system/cloud-init-hotplugd.socket
%{_tmpfilesdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf
%{python3_sitelib}/* %{python3_sitelib}/*
%{_libexecdir}/%{name} %{_libexecdir}/%{name}
@ -185,6 +177,9 @@ python3 -m pytest tests/unittests
%changelog %changelog
* Thu Sep 02 2021 Eduardo Otubo <otubo@redhat.com> - 21.3-1
- Updated to 20.4 [bz#2000540]
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20.4-7 * Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (cloud-init-20.4.tar.gz) = da2fa4673b253468380c4472795fd449809c8ac84d8f13ec1472b9b7e7d54e187ae06e5a81a36774793b05f4e1212dca57bc19aa8955b4c7fa7183cb100bfbb9 SHA512 (cloud-init-21.3.tar.gz) = d248add04b3bf3807ca397fb075a20f55cff9a98116e349c5bf59b44e2d2e76559f92ac37d619551e2c871cdfb35c27a58f4759078d0355d6868e85d13c527bd