Compare commits
No commits in common. "c8" and "c9" have entirely different histories.
99
SOURCES/0001-Add-initial-redhat-changes.patch
Normal file
99
SOURCES/0001-Add-initial-redhat-changes.patch
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
From 03345a88b8b0008a4a81e010d46290f5ba643ebc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
|
Date: Wed, 13 Dec 2023 11:54:55 +0530
|
||||||
|
Subject: [PATCH] Add initial redhat changes
|
||||||
|
|
||||||
|
Adding minimal set of changes necessary for successful build of the package
|
||||||
|
on RHEL/CentOS 9 Stream koji.
|
||||||
|
|
||||||
|
Additional changes on top of the changes in 23.1.1 rebase:
|
||||||
|
- Updated VERSION, TARSHA512, MARKER and BUILD_TARGET_RHEL parameters in
|
||||||
|
Makefile.common in .dist/
|
||||||
|
- Squashed unit test fixes for the downstream changes in cloudinit/settings.py.
|
||||||
|
|
||||||
|
Changes from 23.1.1 rebase follows:
|
||||||
|
|
||||||
|
Merged patches (23.1.1):
|
||||||
|
724a80ac Add TargetRelease
|
||||||
|
967a4405b rhel/cloud.cfg: remove ssh_genkeytypes in settings.py and set in cloud.cfg
|
||||||
|
^ Merged since it removes hunks added in this commit itself
|
||||||
|
|
||||||
|
Discarded because not needed anymore (packit):
|
||||||
|
e3fd7ce12 Configure Packit to ignore the .gitignore file
|
||||||
|
e18654e9 Fixes for packit support
|
||||||
|
|
||||||
|
Discarded because file does not exist anymore and templates are aligned with upstream:
|
||||||
|
3576b12460bf18557857ee25df6bf530dab66612 Adding _netdev to the default mount configuration
|
||||||
|
8092b57ab245856ff1fdde1469960608a489c95e Remove rhel specific files
|
||||||
|
|
||||||
|
Added the following entry to %files to keep track of the new README file in config/clean.d/README
|
||||||
|
%doc %{_sysconfdir}/cloud/clean.d/README
|
||||||
|
|
||||||
|
ignored
|
||||||
|
c75e509b0 Revert "Revert "Setting highest autoconnect priority for network-scripts""
|
||||||
|
0eba5c619 Revert "Setting highest autoconnect priority for network-scripts"
|
||||||
|
|
||||||
|
ignored
|
||||||
|
ba19343c0d9807d0c68a2d8e4ab274f3ca884247 Add Gitlab CI
|
||||||
|
fe09305a5479a4814d6c46df07a906bafa29d637 Delete .gitlab-ci.yml
|
||||||
|
|
||||||
|
Conflicts:
|
||||||
|
missing rhel/ static files and "" instead of '' in setup.py
|
||||||
|
|
||||||
|
X-downstram-only: true
|
||||||
|
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
|
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
||||||
|
---
|
||||||
|
cloudinit/settings.py | 5 +++--
|
||||||
|
tests/unittests/cmd/test_main.py | 15 +++++++++------
|
||||||
|
2 files changed, 12 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
|
||||||
|
index 592e144d..5ced21bd 100644
|
||||||
|
--- a/cloudinit/settings.py
|
||||||
|
+++ b/cloudinit/settings.py
|
||||||
|
@@ -54,13 +54,14 @@ CFG_BUILTIN = {
|
||||||
|
],
|
||||||
|
"def_log_file": "/var/log/cloud-init.log",
|
||||||
|
"log_cfgs": [],
|
||||||
|
- "syslog_fix_perms": ["syslog:adm", "root:adm", "root:wheel", "root:root"],
|
||||||
|
+ "mount_default_fields": [None, None, "auto", "defaults,nofail", "0", "2"],
|
||||||
|
+ "syslog_fix_perms": [],
|
||||||
|
"system_info": {
|
||||||
|
"paths": {
|
||||||
|
"cloud_dir": "/var/lib/cloud",
|
||||||
|
"templates_dir": "/etc/cloud/templates/",
|
||||||
|
},
|
||||||
|
- "distro": "ubuntu",
|
||||||
|
+ "distro": "rhel",
|
||||||
|
"network": {"renderers": None},
|
||||||
|
},
|
||||||
|
"vendor_data": {"enabled": True, "prefix": []},
|
||||||
|
diff --git a/tests/unittests/cmd/test_main.py b/tests/unittests/cmd/test_main.py
|
||||||
|
index ab427115..19d26ebe 100644
|
||||||
|
--- a/tests/unittests/cmd/test_main.py
|
||||||
|
+++ b/tests/unittests/cmd/test_main.py
|
||||||
|
@@ -119,14 +119,17 @@ class TestMain(FilesystemMockingTestCase):
|
||||||
|
{
|
||||||
|
"def_log_file": "/var/log/cloud-init.log",
|
||||||
|
"log_cfgs": [],
|
||||||
|
- "syslog_fix_perms": [
|
||||||
|
- "syslog:adm",
|
||||||
|
- "root:adm",
|
||||||
|
- "root:wheel",
|
||||||
|
- "root:root",
|
||||||
|
- ],
|
||||||
|
"vendor_data": {"enabled": True, "prefix": []},
|
||||||
|
"vendor_data2": {"enabled": True, "prefix": []},
|
||||||
|
+ "syslog_fix_perms": [],
|
||||||
|
+ "mount_default_fields": [
|
||||||
|
+ None,
|
||||||
|
+ None,
|
||||||
|
+ "auto",
|
||||||
|
+ "defaults,nofail",
|
||||||
|
+ "0",
|
||||||
|
+ "2",
|
||||||
|
+ ],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
updated_cfg.pop("system_info")
|
@ -1,32 +1,31 @@
|
|||||||
From 2d3a22bd5b36c20b53f1604e9ff6ce05c98753ec Mon Sep 17 00:00:00 2001
|
From 5129908caa1867c7f584ec8d38607cf56b20521a Mon Sep 17 00:00:00 2001
|
||||||
From: Cathy Avery <cavery@redhat.com>
|
|
||||||
Date: Mon, 18 Dec 2023 12:54:16 -0500
|
|
||||||
Subject: Do not write NM_CONTROLLED=no in generated interface config files
|
|
||||||
|
|
||||||
Squashed from:
|
|
||||||
From 3ee57b044d2b85d8172961258d2edeab82a43772 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Eduardo Otubo <otubo@redhat.com>
|
From: Eduardo Otubo <otubo@redhat.com>
|
||||||
Date: Fri, 7 May 2021 13:36:06 +0200
|
Date: Fri, 7 May 2021 13:36:06 +0200
|
||||||
Subject: [PATCH 02/12] Do not write NM_CONTROLLED=no in generated interface config files
|
Subject: [PATCH] Do not write NM_CONTROLLED=no in generated interface config
|
||||||
|
files
|
||||||
|
|
||||||
From 3a070f23440c9eb6e0e5fb3605e36285e8a5b727 Mon Sep 17 00:00:00 2001
|
Conflicts 20.3:
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
- Not appplying patch on cloudinit/net/sysconfig.py since it now has a
|
||||||
Date: Fri, 23 Jun 2023 16:54:24 +0530
|
mechanism to identify if cloud-init is running on RHEL, having the
|
||||||
Subject: [PATCH 27/51] test fixes: remove NM_CONTROLLED=no from tests
|
correct settings for NM_CONTROLLED.
|
||||||
fixes: b3b96bff187e9 ("Do not write NM_CONTROLLED=no in generated interface config files")
|
|
||||||
|
|
||||||
|
Merged patches (21.1):
|
||||||
|
- ecbace48 sysconfig: Don't write BOOTPROTO=dhcp for ipv6 dhcp
|
||||||
|
- a1a00383 include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
||||||
X-downstream-only: true
|
X-downstream-only: true
|
||||||
|
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
|
||||||
|
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
|
||||||
|
|
||||||
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
||||||
---
|
---
|
||||||
cloudinit/net/sysconfig.py | 1 -
|
cloudinit/net/sysconfig.py | 12 ++++-
|
||||||
tests/unittests/cmd/devel/test_net_convert.py | 1 -
|
tests/unittests/cmd/devel/test_net_convert.py | 1 -
|
||||||
tests/unittests/distros/test_netconfig.py | 8 ---
|
tests/unittests/distros/test_netconfig.py | 8 ---
|
||||||
tests/unittests/test_net.py | 53 -------------------
|
tests/unittests/test_net.py | 53 -------------------
|
||||||
4 files changed, 63 deletions(-)
|
4 files changed, 10 insertions(+), 64 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 7570a5e3..3b7a1f93 100644
|
index 7570a5e3..f01c4236 100644
|
||||||
--- a/cloudinit/net/sysconfig.py
|
--- a/cloudinit/net/sysconfig.py
|
||||||
+++ b/cloudinit/net/sysconfig.py
|
+++ b/cloudinit/net/sysconfig.py
|
||||||
@@ -317,7 +317,6 @@ class Renderer(renderer.Renderer):
|
@@ -317,7 +317,6 @@ class Renderer(renderer.Renderer):
|
||||||
@ -37,6 +36,24 @@ index 7570a5e3..3b7a1f93 100644
|
|||||||
"BOOTPROTO": "none",
|
"BOOTPROTO": "none",
|
||||||
},
|
},
|
||||||
"suse": {"BOOTPROTO": "static", "STARTMODE": "auto"},
|
"suse": {"BOOTPROTO": "static", "STARTMODE": "auto"},
|
||||||
|
@@ -1030,7 +1029,16 @@ class Renderer(renderer.Renderer):
|
||||||
|
# Distros configuring /etc/sysconfig/network as a file e.g. Centos
|
||||||
|
if sysconfig_path.endswith("network"):
|
||||||
|
util.ensure_dir(os.path.dirname(sysconfig_path))
|
||||||
|
- netcfg = [_make_header(), "NETWORKING=yes"]
|
||||||
|
+ netcfg = []
|
||||||
|
+ for line in util.load_file(sysconfig_path, quiet=True).split("\n"):
|
||||||
|
+ if "cloud-init" in line:
|
||||||
|
+ break
|
||||||
|
+ if not line.startswith(
|
||||||
|
+ ("NETWORKING=", "IPV6_AUTOCONF=", "NETWORKING_IPV6=")
|
||||||
|
+ ):
|
||||||
|
+ netcfg.append(line)
|
||||||
|
+ # Now generate the cloud-init portion of sysconfig/network
|
||||||
|
+ netcfg.extend([_make_header(), "NETWORKING=yes"])
|
||||||
|
if network_state.use_ipv6:
|
||||||
|
netcfg.append("NETWORKING_IPV6=yes")
|
||||||
|
netcfg.append("IPV6_AUTOCONF=no")
|
||||||
diff --git a/tests/unittests/cmd/devel/test_net_convert.py b/tests/unittests/cmd/devel/test_net_convert.py
|
diff --git a/tests/unittests/cmd/devel/test_net_convert.py b/tests/unittests/cmd/devel/test_net_convert.py
|
||||||
index fb72963f..7b9121b2 100644
|
index fb72963f..7b9121b2 100644
|
||||||
--- a/tests/unittests/cmd/devel/test_net_convert.py
|
--- a/tests/unittests/cmd/devel/test_net_convert.py
|
||||||
@ -545,6 +562,3 @@ index c5509536..052b0674 100644
|
|||||||
ONBOOT=yes
|
ONBOOT=yes
|
||||||
TYPE=Ethernet
|
TYPE=Ethernet
|
||||||
USERCTL=no
|
USERCTL=no
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -0,0 +1,582 @@
|
|||||||
|
From 8a2fcbbcfdfc1df6f6c18f96588154f40083a239 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
|
Date: Wed, 13 Dec 2023 11:55:16 +0530
|
||||||
|
Subject: [PATCH] Setting autoconnect priority setting for network-scripts
|
||||||
|
|
||||||
|
Squashed the following three downstream only commits from RHEL 9.3:
|
||||||
|
|
||||||
|
Commit 1:
|
||||||
|
|
||||||
|
Setting highest autoconnect priority for network-scripts
|
||||||
|
|
||||||
|
RH-Author: Eduardo Otubo <otubo@redhat.com>
|
||||||
|
RH-MergeRequest: 22: Setting highest autoconnect priority for network-scripts
|
||||||
|
RH-Commit: [1/1] 34f1d62f8934a983a124df95b861a1e448681d3b (otubo/cloud-init-src)
|
||||||
|
RH-Bugzilla: 2036060
|
||||||
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
|
|
||||||
|
Set the highest autoconnect priority for network-scripts which is
|
||||||
|
loaded by NetworkManager ifcfg-rh plugin. Note that keyfile is the only
|
||||||
|
and default existing plugin on RHEL9, by setting the highest autoconnect
|
||||||
|
priority for network-scripts, NetworkManager will activate
|
||||||
|
network-scripts but keyfile. Network-scripts path:
|
||||||
|
|
||||||
|
Since this is a blocking issue, we decided to have this one-liner
|
||||||
|
downstream-only patch so we can move forward and have a better
|
||||||
|
NetworkManager support later on the release.
|
||||||
|
|
||||||
|
rhbz: 2036060
|
||||||
|
x-downstream-only: yes
|
||||||
|
|
||||||
|
Commit 2:
|
||||||
|
|
||||||
|
net/sysconfig: do not use the highest autoconnect priority
|
||||||
|
|
||||||
|
Using the highest priority is a very big hammer that we may not want to use. We
|
||||||
|
may want users to override the cloud init generated ifcfg files for custom
|
||||||
|
configuration of interfaces. If cloud init uses the highest priority, nothing
|
||||||
|
can beat it. Hence lower the priority to 120 allowing values from 121 to 999
|
||||||
|
to be used by users if they want to use a custom interface nm keyfile.
|
||||||
|
|
||||||
|
X-downstream-only: true
|
||||||
|
|
||||||
|
Suggested-by: thaller@redhat.com
|
||||||
|
fixes: c589da20eb92231 ("Setting highest autoconnect priority for network-scripts")
|
||||||
|
|
||||||
|
Commit 3:
|
||||||
|
|
||||||
|
test fixes: update tests to reflect AUTOCONNECT_PRIORITY setting
|
||||||
|
|
||||||
|
X-downstream-only: true
|
||||||
|
fixes: 0a2c6b6118ff ("net/sysconfig: do not use the highest autoconnect priority")
|
||||||
|
fixes: c589da20eb92 ("Setting highest autoconnect priority for network-scripts")
|
||||||
|
|
||||||
|
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
||||||
|
---
|
||||||
|
cloudinit/net/sysconfig.py | 1 +
|
||||||
|
tests/unittests/cmd/devel/test_net_convert.py | 1 +
|
||||||
|
tests/unittests/distros/test_netconfig.py | 8 +++
|
||||||
|
tests/unittests/test_net.py | 53 +++++++++++++++++++
|
||||||
|
4 files changed, 63 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
|
||||||
|
index f01c4236..d39f4fe3 100644
|
||||||
|
--- a/cloudinit/net/sysconfig.py
|
||||||
|
+++ b/cloudinit/net/sysconfig.py
|
||||||
|
@@ -318,6 +318,7 @@ class Renderer(renderer.Renderer):
|
||||||
|
"ONBOOT": True,
|
||||||
|
"USERCTL": False,
|
||||||
|
"BOOTPROTO": "none",
|
||||||
|
+ "AUTOCONNECT_PRIORITY": 120,
|
||||||
|
},
|
||||||
|
"suse": {"BOOTPROTO": "static", "STARTMODE": "auto"},
|
||||||
|
}
|
||||||
|
diff --git a/tests/unittests/cmd/devel/test_net_convert.py b/tests/unittests/cmd/devel/test_net_convert.py
|
||||||
|
index 7b9121b2..288e3e37 100644
|
||||||
|
--- a/tests/unittests/cmd/devel/test_net_convert.py
|
||||||
|
+++ b/tests/unittests/cmd/devel/test_net_convert.py
|
||||||
|
@@ -60,6 +60,7 @@ DHCP=ipv4
|
||||||
|
SAMPLE_SYSCONFIG_CONTENT = """\
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth0
|
||||||
|
ONBOOT=yes
|
||||||
|
diff --git a/tests/unittests/distros/test_netconfig.py b/tests/unittests/distros/test_netconfig.py
|
||||||
|
index 962ff7fb..4c624079 100644
|
||||||
|
--- a/tests/unittests/distros/test_netconfig.py
|
||||||
|
+++ b/tests/unittests/distros/test_netconfig.py
|
||||||
|
@@ -717,6 +717,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
expected_cfgs = {
|
||||||
|
self.ifcfg_path("eth0"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -730,6 +731,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
),
|
||||||
|
self.ifcfg_path("eth1"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth1
|
||||||
|
ONBOOT=yes
|
||||||
|
@@ -754,6 +756,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
expected_cfgs = {
|
||||||
|
self.ifcfg_path("eth0"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -769,6 +772,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
),
|
||||||
|
self.ifcfg_path("eth1"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth1
|
||||||
|
ONBOOT=yes
|
||||||
|
@@ -812,6 +816,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
expected_cfgs = {
|
||||||
|
self.ifcfg_path("eth0"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth0
|
||||||
|
HWADDR=00:16:3e:60:7c:df
|
||||||
|
@@ -824,6 +829,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
),
|
||||||
|
self.ifcfg_path("infra0"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=infra0
|
||||||
|
IPADDR=10.0.1.2
|
||||||
|
@@ -859,6 +865,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
expected_cfgs = {
|
||||||
|
self.ifcfg_path("eth0"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth0
|
||||||
|
IPADDR=192.10.1.2
|
||||||
|
@@ -870,6 +877,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
||||||
|
),
|
||||||
|
self.ifcfg_path("eth0.1001"): dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth0.1001
|
||||||
|
IPADDR=10.0.1.2
|
||||||
|
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
|
||||||
|
index 052b0674..cef4fa2d 100644
|
||||||
|
--- a/tests/unittests/test_net.py
|
||||||
|
+++ b/tests/unittests/test_net.py
|
||||||
|
@@ -578,6 +578,7 @@ dns = none
|
||||||
|
"""
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -740,6 +741,7 @@ dns = none
|
||||||
|
"""
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -897,6 +899,7 @@ dns = none
|
||||||
|
"""
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -1137,6 +1140,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-eth1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth1
|
||||||
|
HWADDR=cf:d6:af:48:e8:80
|
||||||
|
@@ -1146,6 +1150,7 @@ NETWORK_CONFIGS = {
|
||||||
|
),
|
||||||
|
"ifcfg-eth99": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth99
|
||||||
|
@@ -1311,6 +1316,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-eth1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth1
|
||||||
|
HWADDR=cf:d6:af:48:e8:80
|
||||||
|
@@ -1320,6 +1326,7 @@ NETWORK_CONFIGS = {
|
||||||
|
),
|
||||||
|
"ifcfg-eth99": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth99
|
||||||
|
@@ -1566,6 +1573,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
IPADDR=192.168.14.2
|
||||||
|
@@ -1712,6 +1720,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
DHCPV6C=yes
|
||||||
|
@@ -1801,6 +1810,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
DHCPV6C=yes
|
||||||
|
@@ -1876,6 +1886,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
DHCPV6C=yes
|
||||||
|
@@ -1940,6 +1951,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
IPV6_AUTOCONF=yes
|
||||||
|
@@ -1995,6 +2007,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
IPV6ADDR=2001:1::1/64
|
||||||
|
@@ -2051,6 +2064,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
DHCPV6C=yes
|
||||||
|
@@ -2135,6 +2149,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=iface0
|
||||||
|
DHCPV6C=yes
|
||||||
|
@@ -2181,6 +2196,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=iface0
|
||||||
|
ONBOOT=yes
|
||||||
|
@@ -2256,6 +2272,7 @@ NETWORK_CONFIGS = {
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-iface0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=iface0
|
||||||
|
ETHTOOL_OPTS="wol g"
|
||||||
|
@@ -2591,6 +2608,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-bond0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BONDING_MASTER=yes
|
||||||
|
BONDING_OPTS="mode=active-backup """
|
||||||
|
"""xmit_hash_policy=layer3+4 """
|
||||||
|
@@ -2608,6 +2626,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-bond0.200": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=bond0.200
|
||||||
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
||||||
|
@@ -2619,6 +2638,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
"ifcfg-br0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
AGEING=250
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=br0
|
||||||
|
@@ -2638,6 +2658,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth0
|
||||||
|
HWADDR=c0:d6:9f:2c:e8:80
|
||||||
|
@@ -2647,6 +2668,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth0.101": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0.101
|
||||||
|
@@ -2666,6 +2688,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth1
|
||||||
|
HWADDR=aa:d6:9f:2c:e8:80
|
||||||
|
@@ -2677,6 +2700,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth2": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth2
|
||||||
|
HWADDR=c0:bb:9f:2c:e8:80
|
||||||
|
@@ -2688,6 +2712,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth3": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
BRIDGE=br0
|
||||||
|
DEVICE=eth3
|
||||||
|
@@ -2698,6 +2723,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth4": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
BRIDGE=br0
|
||||||
|
DEVICE=eth4
|
||||||
|
@@ -2708,6 +2734,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-eth5": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth5
|
||||||
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
||||||
|
@@ -2718,6 +2745,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
|
),
|
||||||
|
"ifcfg-ib0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=ib0
|
||||||
|
HWADDR=a0:00:02:20:fe:80:00:00:00:00:00:00:ec:0d:9a:03:00:15:e2:c1
|
||||||
|
@@ -3422,6 +3450,7 @@ iface bond0 inet6 static
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-bond0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BONDING_MASTER=yes
|
||||||
|
BONDING_OPTS="mode=active-backup xmit_hash_policy=layer3+4 """
|
||||||
|
"""miimon=100 num_grat_arp=5 """
|
||||||
|
@@ -3452,6 +3481,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-bond0s0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=bond0s0
|
||||||
|
HWADDR=aa:bb:cc:dd:e8:00
|
||||||
|
@@ -3479,6 +3509,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-bond0s1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=bond0s1
|
||||||
|
HWADDR=aa:bb:cc:dd:e8:01
|
||||||
|
@@ -3628,6 +3659,7 @@ iface bond0 inet6 static
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-en0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=en0
|
||||||
|
HWADDR=aa:bb:cc:dd:e8:00
|
||||||
|
@@ -3637,6 +3669,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-en0.99": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=en0.99
|
||||||
|
@@ -3774,6 +3807,7 @@ iface bond0 inet6 static
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-br0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=br0
|
||||||
|
IPADDR=192.168.2.2
|
||||||
|
@@ -3787,6 +3821,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-eth0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
BRIDGE=br0
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -3802,6 +3837,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-eth1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
BRIDGE=br0
|
||||||
|
DEVICE=eth1
|
||||||
|
@@ -3989,6 +4025,7 @@ iface bond0 inet6 static
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-eth0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth0
|
||||||
|
HWADDR=52:54:00:12:34:00
|
||||||
|
@@ -4001,6 +4038,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-eth1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth1
|
||||||
|
HWADDR=52:54:00:12:34:aa
|
||||||
|
@@ -4012,6 +4050,7 @@ iface bond0 inet6 static
|
||||||
|
),
|
||||||
|
"ifcfg-eth2": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth2
|
||||||
|
HWADDR=52:54:00:12:34:ff
|
||||||
|
@@ -4096,6 +4135,7 @@ iface bond0 inet6 static
|
||||||
|
"expected_sysconfig_rhel": {
|
||||||
|
"ifcfg-eth0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eth0
|
||||||
|
HWADDR=cf:d6:af:48:e8:80
|
||||||
|
@@ -4693,6 +4733,7 @@ class TestRhelSysConfigRendering(CiTestCase):
|
||||||
|
expected_content = """
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth1000
|
||||||
|
HWADDR=07-1c-c6-75-a4-be
|
||||||
|
@@ -4900,6 +4941,7 @@ USERCTL=no
|
||||||
|
expected = """\
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=interface0
|
||||||
|
@@ -4929,6 +4971,7 @@ USERCTL=no
|
||||||
|
expected_i1 = """\
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
||||||
|
@@ -4945,6 +4988,7 @@ USERCTL=no
|
||||||
|
expected_i2 = """\
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth1
|
||||||
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
||||||
|
@@ -4972,6 +5016,7 @@ USERCTL=no
|
||||||
|
expected = """\
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eth0
|
||||||
|
ONBOOT=yes
|
||||||
|
@@ -5191,6 +5236,7 @@ USERCTL=no
|
||||||
|
"expected_sysconfig": {
|
||||||
|
"ifcfg-ens3": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=ens3
|
||||||
|
@@ -5235,6 +5281,7 @@ USERCTL=no
|
||||||
|
expected = {
|
||||||
|
"ifcfg-eno1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eno1
|
||||||
|
ONBOOT=yes
|
||||||
|
@@ -5244,6 +5291,7 @@ USERCTL=no
|
||||||
|
),
|
||||||
|
"ifcfg-eno1.1000": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=eno1.1000
|
||||||
|
IPADDR=192.6.1.9
|
||||||
|
@@ -5276,6 +5324,7 @@ USERCTL=no
|
||||||
|
expected = {
|
||||||
|
"ifcfg-bond0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BONDING_MASTER=yes
|
||||||
|
BONDING_SLAVE0=enp0s0
|
||||||
|
BONDING_SLAVE1=enp0s1
|
||||||
|
@@ -5291,6 +5340,7 @@ USERCTL=no
|
||||||
|
),
|
||||||
|
"ifcfg-enp0s0": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BONDING_MASTER=yes
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=enp0s0
|
||||||
|
@@ -5303,6 +5353,7 @@ USERCTL=no
|
||||||
|
),
|
||||||
|
"ifcfg-enp0s1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BONDING_MASTER=yes
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEVICE=enp0s1
|
||||||
|
@@ -5333,6 +5384,7 @@ USERCTL=no
|
||||||
|
expected = {
|
||||||
|
"ifcfg-eno1": textwrap.dedent(
|
||||||
|
"""\
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
DEVICE=eno1
|
||||||
|
HWADDR=07-1c-c6-75-a4-be
|
||||||
|
@@ -5411,6 +5463,7 @@ USERCTL=no
|
||||||
|
"""\
|
||||||
|
# Created by cloud-init automatically, do not edit.
|
||||||
|
#
|
||||||
|
+ AUTOCONNECT_PRIORITY=120
|
||||||
|
BOOTPROTO=none
|
||||||
|
DEFROUTE=yes
|
||||||
|
DEVICE=eth0
|
@ -1,53 +0,0 @@
|
|||||||
From fea3e7fc6d23e988cf4a33dc03064ff31bf1d72d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Eduardo Otubo <otubo@redhat.com>
|
|
||||||
Date: Fri, 7 May 2021 13:36:13 +0200
|
|
||||||
Subject: include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
|
||||||
|
|
||||||
RH-Author: Eduardo Otubo <otubo@redhat.com>
|
|
||||||
Message-id: <20190320114559.23708-1-otubo@redhat.com>
|
|
||||||
Patchwork-id: 84937
|
|
||||||
O-Subject: [RHEL-7.7 cloud-init PATCH] include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
|
||||||
Bugzilla: 1653131
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Acked-by: Mohammed Gamal <mgamal@redhat.com>
|
|
||||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
||||||
|
|
||||||
The option NOZEROCONF=yes is not included by default in
|
|
||||||
/etc/sysconfig/network, which is required by Overcloud instances. The
|
|
||||||
patch also includes tests for the modifications.
|
|
||||||
|
|
||||||
X-downstream-only: yes
|
|
||||||
Resolves: rhbz#1653131
|
|
||||||
|
|
||||||
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
|
|
||||||
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
||||||
(cherry picked from commit ffa647e83efd4293bd027e9e390274aad8a12d94)
|
|
||||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
---
|
|
||||||
cloudinit/net/sysconfig.py | 11 ++++++++++-
|
|
||||||
redhat/scripts/frh.py | 10 +++++++---
|
|
||||||
2 files changed, 17 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
|
|
||||||
index 3b7a1f93..f01c4236 100644
|
|
||||||
--- a/cloudinit/net/sysconfig.py
|
|
||||||
+++ b/cloudinit/net/sysconfig.py
|
|
||||||
@@ -1029,7 +1029,16 @@ class Renderer(renderer.Renderer):
|
|
||||||
# Distros configuring /etc/sysconfig/network as a file e.g. Centos
|
|
||||||
if sysconfig_path.endswith("network"):
|
|
||||||
util.ensure_dir(os.path.dirname(sysconfig_path))
|
|
||||||
- netcfg = [_make_header(), "NETWORKING=yes"]
|
|
||||||
+ netcfg = []
|
|
||||||
+ for line in util.load_file(sysconfig_path, quiet=True).split("\n"):
|
|
||||||
+ if "cloud-init" in line:
|
|
||||||
+ break
|
|
||||||
+ if not line.startswith(
|
|
||||||
+ ("NETWORKING=", "IPV6_AUTOCONF=", "NETWORKING_IPV6=")
|
|
||||||
+ ):
|
|
||||||
+ netcfg.append(line)
|
|
||||||
+ # Now generate the cloud-init portion of sysconfig/network
|
|
||||||
+ netcfg.extend([_make_header(), "NETWORKING=yes"])
|
|
||||||
if network_state.use_ipv6:
|
|
||||||
netcfg.append("NETWORKING_IPV6=yes")
|
|
||||||
netcfg.append("IPV6_AUTOCONF=no")
|
|
@ -1,15 +1,8 @@
|
|||||||
From 010cd58942c82e902bc02cb5a34074f6083fc890 Mon Sep 17 00:00:00 2001
|
From 5fa8113a9efaa90f293b95477c4fa44e3d4b6537 Mon Sep 17 00:00:00 2001
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
Date: Thu, 23 Nov 2023 12:27:51 +0530
|
Date: Thu, 23 Nov 2023 12:27:51 +0530
|
||||||
Subject: [PATCH 1/3] net/network_manager: do not set "may-fail" to False for
|
Subject: [PATCH] net/network_manager: do not set "may-fail" to False for both
|
||||||
both ipv4 and ipv6 dhcp
|
ipv4 and ipv6 dhcp
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 119: net: allow dhcp6 configuration from generate_fallback_configuration()
|
|
||||||
RH-Jira: RHEL-7277
|
|
||||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Commit: [1/2] be07418f69a4c461e2fa02a72b7b985053af9660
|
|
||||||
|
|
||||||
If "may-fail" is set to False in the Network Manager keyfile for both ipv4
|
If "may-fail" is set to False in the Network Manager keyfile for both ipv4
|
||||||
and ipv6 for dhcp configuration, it essentially means both ipv4 and ipv6 network
|
and ipv6 for dhcp configuration, it essentially means both ipv4 and ipv6 network
|
||||||
@ -114,10 +107,10 @@ index 8374cfcc..8a99eb3a 100644
|
|||||||
ipv4_mtu = device_mtu
|
ipv4_mtu = device_mtu
|
||||||
if not ipv4_mtu == device_mtu:
|
if not ipv4_mtu == device_mtu:
|
||||||
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 052b0674..54d053f3 100644
|
index cef4fa2d..fb4c863c 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
|
||||||
@@ -1470,11 +1470,11 @@ NETWORK_CONFIGS = {
|
@@ -1477,11 +1477,11 @@ NETWORK_CONFIGS = {
|
||||||
|
|
||||||
[ipv4]
|
[ipv4]
|
||||||
method=auto
|
method=auto
|
||||||
@ -131,7 +124,7 @@ index 052b0674..54d053f3 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -1642,11 +1642,11 @@ NETWORK_CONFIGS = {
|
@@ -1650,11 +1650,11 @@ NETWORK_CONFIGS = {
|
||||||
|
|
||||||
[ipv6]
|
[ipv6]
|
||||||
method=auto
|
method=auto
|
||||||
@ -145,6 +138,3 @@ index 052b0674..54d053f3 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,16 +1,9 @@
|
|||||||
From 2942fb776cd1fc765089ebd0004e01dc2b3a5920 Mon Sep 17 00:00:00 2001
|
From 54e87eaad7841270e530beff2dcfe68292ae87ef Mon Sep 17 00:00:00 2001
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
Date: Tue, 21 Nov 2023 13:57:15 +0530
|
Date: Tue, 21 Nov 2023 13:57:15 +0530
|
||||||
Subject: [PATCH 2/3] net: allow dhcp6 configuration from
|
Subject: [PATCH] net: allow dhcp6 configuration from
|
||||||
generate_fallback_configuration()
|
generate_fallback_configuration()
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 119: net: allow dhcp6 configuration from generate_fallback_configuration()
|
|
||||||
RH-Jira: RHEL-7277
|
|
||||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Commit: [2/2] b067c813488dfddc79d8ebd5bb51894ff040c356
|
|
||||||
|
|
||||||
This will make sure on Azure we can use both dhcp4 and dhcp6 when IMDS is not
|
This will make sure on Azure we can use both dhcp4 and dhcp6 when IMDS is not
|
||||||
used. This is useful in situations where only ipv6 network is available and
|
used. This is useful in situations where only ipv6 network is available and
|
||||||
there is no dhcp4 running.
|
there is no dhcp4 running.
|
||||||
@ -86,10 +79,10 @@ index 561d5151..60a44186 100644
|
|||||||
"set-name": "ens3",
|
"set-name": "ens3",
|
||||||
}
|
}
|
||||||
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 54d053f3..e52c2497 100644
|
index fb4c863c..d9ef493b 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
|
||||||
@@ -4299,6 +4299,7 @@ class TestGenerateFallbackConfig(CiTestCase):
|
@@ -4339,6 +4339,7 @@ class TestGenerateFallbackConfig(CiTestCase):
|
||||||
"ethernets": {
|
"ethernets": {
|
||||||
"eth0": {
|
"eth0": {
|
||||||
"dhcp4": True,
|
"dhcp4": True,
|
||||||
@ -97,7 +90,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
"set-name": "eth0",
|
"set-name": "eth0",
|
||||||
"match": {
|
"match": {
|
||||||
"macaddress": "00:11:22:33:44:55",
|
"macaddress": "00:11:22:33:44:55",
|
||||||
@@ -4383,6 +4384,9 @@ iface lo inet loopback
|
@@ -4423,6 +4424,9 @@ iface lo inet loopback
|
||||||
|
|
||||||
auto eth0
|
auto eth0
|
||||||
iface eth0 inet dhcp
|
iface eth0 inet dhcp
|
||||||
@ -107,7 +100,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
"""
|
"""
|
||||||
self.assertEqual(expected.lstrip(), contents.lstrip())
|
self.assertEqual(expected.lstrip(), contents.lstrip())
|
||||||
|
|
||||||
@@ -4472,6 +4476,9 @@ iface lo inet loopback
|
@@ -4512,6 +4516,9 @@ iface lo inet loopback
|
||||||
|
|
||||||
auto eth1
|
auto eth1
|
||||||
iface eth1 inet dhcp
|
iface eth1 inet dhcp
|
||||||
@ -117,8 +110,8 @@ index 54d053f3..e52c2497 100644
|
|||||||
"""
|
"""
|
||||||
self.assertEqual(expected.lstrip(), contents.lstrip())
|
self.assertEqual(expected.lstrip(), contents.lstrip())
|
||||||
|
|
||||||
@@ -4695,7 +4702,9 @@ class TestRhelSysConfigRendering(CiTestCase):
|
@@ -4736,7 +4743,9 @@ class TestRhelSysConfigRendering(CiTestCase):
|
||||||
#
|
AUTOCONNECT_PRIORITY=120
|
||||||
BOOTPROTO=dhcp
|
BOOTPROTO=dhcp
|
||||||
DEVICE=eth1000
|
DEVICE=eth1000
|
||||||
+DHCPV6C=yes
|
+DHCPV6C=yes
|
||||||
@ -127,7 +120,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
ONBOOT=yes
|
ONBOOT=yes
|
||||||
TYPE=Ethernet
|
TYPE=Ethernet
|
||||||
USERCTL=no
|
USERCTL=no
|
||||||
@@ -5593,7 +5602,8 @@ class TestOpenSuseSysConfigRendering(CiTestCase):
|
@@ -5646,7 +5655,8 @@ class TestOpenSuseSysConfigRendering(CiTestCase):
|
||||||
expected_content = """
|
expected_content = """
|
||||||
# Created by cloud-init automatically, do not edit.
|
# Created by cloud-init automatically, do not edit.
|
||||||
#
|
#
|
||||||
@ -137,7 +130,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
LLADDR=07-1c-c6-75-a4-be
|
LLADDR=07-1c-c6-75-a4-be
|
||||||
STARTMODE=auto
|
STARTMODE=auto
|
||||||
""".lstrip()
|
""".lstrip()
|
||||||
@@ -5979,7 +5989,11 @@ class TestNetworkManagerRendering(CiTestCase):
|
@@ -6032,7 +6042,11 @@ class TestNetworkManagerRendering(CiTestCase):
|
||||||
|
|
||||||
[ipv4]
|
[ipv4]
|
||||||
method=auto
|
method=auto
|
||||||
@ -150,7 +143,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -6245,6 +6259,9 @@ iface lo inet loopback
|
@@ -6298,6 +6312,9 @@ iface lo inet loopback
|
||||||
|
|
||||||
auto eth1000
|
auto eth1000
|
||||||
iface eth1000 inet dhcp
|
iface eth1000 inet dhcp
|
||||||
@ -160,7 +153,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
"""
|
"""
|
||||||
self.assertEqual(expected.lstrip(), contents.lstrip())
|
self.assertEqual(expected.lstrip(), contents.lstrip())
|
||||||
|
|
||||||
@@ -6304,6 +6321,7 @@ class TestNetplanNetRendering:
|
@@ -6357,6 +6374,7 @@ class TestNetplanNetRendering:
|
||||||
ethernets:
|
ethernets:
|
||||||
eth1000:
|
eth1000:
|
||||||
dhcp4: true
|
dhcp4: true
|
||||||
@ -168,7 +161,7 @@ index 54d053f3..e52c2497 100644
|
|||||||
match:
|
match:
|
||||||
macaddress: 07-1c-c6-75-a4-be
|
macaddress: 07-1c-c6-75-a4-be
|
||||||
set-name: eth1000
|
set-name: eth1000
|
||||||
@@ -7803,7 +7821,7 @@ class TestNetworkdNetRendering(CiTestCase):
|
@@ -7856,7 +7874,7 @@ class TestNetworkdNetRendering(CiTestCase):
|
||||||
Name=eth1000
|
Name=eth1000
|
||||||
MACAddress=07-1c-c6-75-a4-be
|
MACAddress=07-1c-c6-75-a4-be
|
||||||
[Network]
|
[Network]
|
||||||
@ -177,6 +170,3 @@ index 54d053f3..e52c2497 100644
|
|||||||
).rstrip(" ")
|
).rstrip(" ")
|
||||||
|
|
||||||
expected = self.create_conf_dict(expected.splitlines())
|
expected = self.create_conf_dict(expected.splitlines())
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
|||||||
From f7236c817aee8c39223cca88deb8341b4f2b5dfa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Cathy Avery <cavery@redhat.com>
|
|
||||||
Date: Mon, 18 Dec 2023 14:13:19 -0500
|
|
||||||
Subject: settings.py: update settings for rhel
|
|
||||||
|
|
||||||
commit 2bf34313f2e9599e3304b5446411b5ada6ccd7f0
|
|
||||||
Author: Ani Sinha <anisinha@redhat.com>
|
|
||||||
Date: Tue Apr 11 04:20:00 2023 -0400
|
|
||||||
Please see commit 5e1e568d7085fd4443
|
|
||||||
|
|
||||||
(" Add initial redhat setup")
|
|
||||||
from rhel8.8.0 branch for setings.py. Applying the same for the rebased
|
|
||||||
cloud-init.
|
|
||||||
|
|
||||||
X-downstream-only: true
|
|
||||||
|
|
||||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
|
|
||||||
Conflicts: "def_log_file_mode": 0o600 as commit
|
|
||||||
130899115 'limit permissions on def_log_file' was not applied.
|
|
||||||
|
|
||||||
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
---
|
|
||||||
cloudinit/settings.py | 7 +++++--
|
|
||||||
tests/unittests/cmd/test_main.py | 17 +++++++++++------
|
|
||||||
2 files changed, 16 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
|
|
||||||
index 592e144d..87829ff0 100644
|
|
||||||
--- a/cloudinit/settings.py
|
|
||||||
+++ b/cloudinit/settings.py
|
|
||||||
@@ -54,13 +54,16 @@ CFG_BUILTIN = {
|
|
||||||
],
|
|
||||||
"def_log_file": "/var/log/cloud-init.log",
|
|
||||||
"log_cfgs": [],
|
|
||||||
- "syslog_fix_perms": ["syslog:adm", "root:adm", "root:wheel", "root:root"],
|
|
||||||
+ "syslog_fix_perms": [],
|
|
||||||
+ "mount_default_fields": [None, None, "auto", "defaults,nofail", "0", "2"],
|
|
||||||
+ "ssh_deletekeys": False,
|
|
||||||
+ "ssh_genkeytypes": [],
|
|
||||||
"system_info": {
|
|
||||||
"paths": {
|
|
||||||
"cloud_dir": "/var/lib/cloud",
|
|
||||||
"templates_dir": "/etc/cloud/templates/",
|
|
||||||
},
|
|
||||||
- "distro": "ubuntu",
|
|
||||||
+ "distro": "rhel",
|
|
||||||
"network": {"renderers": None},
|
|
||||||
},
|
|
||||||
"vendor_data": {"enabled": True, "prefix": []},
|
|
||||||
diff --git a/tests/unittests/cmd/test_main.py b/tests/unittests/cmd/test_main.py
|
|
||||||
index ab427115..c8c2ae81 100644
|
|
||||||
--- a/tests/unittests/cmd/test_main.py
|
|
||||||
+++ b/tests/unittests/cmd/test_main.py
|
|
||||||
@@ -119,14 +119,19 @@ class TestMain(FilesystemMockingTestCase):
|
|
||||||
{
|
|
||||||
"def_log_file": "/var/log/cloud-init.log",
|
|
||||||
"log_cfgs": [],
|
|
||||||
- "syslog_fix_perms": [
|
|
||||||
- "syslog:adm",
|
|
||||||
- "root:adm",
|
|
||||||
- "root:wheel",
|
|
||||||
- "root:root",
|
|
||||||
- ],
|
|
||||||
"vendor_data": {"enabled": True, "prefix": []},
|
|
||||||
"vendor_data2": {"enabled": True, "prefix": []},
|
|
||||||
+ "syslog_fix_perms": [],
|
|
||||||
+ "ssh_deletekeys": False,
|
|
||||||
+ "ssh_genkeytypes": [],
|
|
||||||
+ "mount_default_fields": [
|
|
||||||
+ None,
|
|
||||||
+ None,
|
|
||||||
+ "auto",
|
|
||||||
+ "defaults,nofail",
|
|
||||||
+ "0",
|
|
||||||
+ "2",
|
|
||||||
+ ],
|
|
||||||
}
|
|
||||||
)
|
|
||||||
updated_cfg.pop("system_info")
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,15 +1,8 @@
|
|||||||
From ffc8f3fbb4c8c14a4ef2b6a99a9ea61da4bedde7 Mon Sep 17 00:00:00 2001
|
From c0df864e373e1e34bf23c4869acdf7d20aea7aaf Mon Sep 17 00:00:00 2001
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
Date: Thu, 7 Dec 2023 02:39:51 +0530
|
Date: Thu, 7 Dec 2023 02:39:51 +0530
|
||||||
Subject: [PATCH 3/3] net/nm: check for presence of ifcfg files when nm
|
Subject: [PATCH] net/nm: check for presence of ifcfg files when nm connection
|
||||||
connection files are absent (#4645)
|
files are absent (#4645)
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 120: net/nm: check for presence of ifcfg files when nm connection files are absent (#4645)
|
|
||||||
RH-Jira: RHEL-17610
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
|
||||||
RH-Commit: [1/1] e0647418de8b70724a32500f26f544650d701404
|
|
||||||
|
|
||||||
On systems that use network manager to manage connections and activate network
|
On systems that use network manager to manage connections and activate network
|
||||||
interfaces, they may also use ifcfg files for configuring
|
interfaces, they may also use ifcfg files for configuring
|
||||||
@ -118,6 +111,3 @@ index 8a99eb3a..76a0ac15 100644
|
|||||||
def cloud_init_nm_conf_filename(target=None):
|
def cloud_init_nm_conf_filename(target=None):
|
||||||
target_con_dir = subp.target_path(target, NM_RUN_DIR)
|
target_con_dir = subp.target_path(target, NM_RUN_DIR)
|
||||||
conf_file = "30-cloud-init-ip6-addr-gen-mode.conf"
|
conf_file = "30-cloud-init-ip6-addr-gen-mode.conf"
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,14 +1,7 @@
|
|||||||
From c43791eeb00bc9000abff0125c18aa6a7e8b7160 Mon Sep 17 00:00:00 2001
|
From e5258b60a3dbf44ef1faac91db2b45dab09de0b5 Mon Sep 17 00:00:00 2001
|
||||||
From: Brett Holman <brett.holman@canonical.com>
|
From: Brett Holman <brett.holman@canonical.com>
|
||||||
Date: Tue, 16 Jan 2024 12:43:17 -0700
|
Date: Tue, 16 Jan 2024 12:43:17 -0700
|
||||||
Subject: [PATCH 2/2] test(jsonschema): Pin jsonschema version (#4781)
|
Subject: [PATCH] test(jsonschema): Pin jsonschema version (#4781)
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 121: fix(clean): stop warning when running clean command (#4761)
|
|
||||||
RH-Jira: RHEL-21530
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Commit: [2/2] f864085d47723b3fb462c3b6fc6e24b90bf040aa
|
|
||||||
|
|
||||||
Release 4.21.0 broke tests
|
Release 4.21.0 broke tests
|
||||||
|
|
||||||
@ -43,6 +36,3 @@ index 19488b94..46a98b4c 100644
|
|||||||
+jsonschema<=4.20.0
|
+jsonschema<=4.20.0
|
||||||
responses
|
responses
|
||||||
passlib
|
passlib
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,15 +1,7 @@
|
|||||||
From a622a094a1f497c87a66932382265c2dbf1b88a2 Mon Sep 17 00:00:00 2001
|
From 9e8fbb736d5e8db8bcf0fbc35a76bdad9251990a Mon Sep 17 00:00:00 2001
|
||||||
From: d1r3ct0r <calvin.mwadime@canonical.com>
|
From: d1r3ct0r <calvin.mwadime@canonical.com>
|
||||||
Date: Sat, 20 Jan 2024 02:11:47 +0300
|
Date: Sat, 20 Jan 2024 02:11:47 +0300
|
||||||
Subject: [PATCH 1/2] fix(clean): stop warning when running clean command
|
Subject: [PATCH] fix(clean): stop warning when running clean command (#4761)
|
||||||
(#4761)
|
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 121: fix(clean): stop warning when running clean command (#4761)
|
|
||||||
RH-Jira: RHEL-21530
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Commit: [1/2] f7a20c627afabf00db20c80ecd6e7f577053863b
|
|
||||||
|
|
||||||
When the clean command is run, runparts is called and README in
|
When the clean command is run, runparts is called and README in
|
||||||
/etc/cloud/clean.d is not executable which leads to a warning.
|
/etc/cloud/clean.d is not executable which leads to a warning.
|
||||||
@ -22,11 +14,11 @@ Fixes: GH-4760
|
|||||||
(cherry picked from commit da08a260965e35fa63def1cd8b8b472f7c354ffe)
|
(cherry picked from commit da08a260965e35fa63def1cd8b8b472f7c354ffe)
|
||||||
|
|
||||||
There is a downstream only change that is squashed with the upstream commit.
|
There is a downstream only change that is squashed with the upstream commit.
|
||||||
The spec file under `redhat/` has been updated so as to not include
|
The spec file under .distro/ has been updated so as to not include
|
||||||
`/etc/cloud/clean.d/README` file. Otherwise, we shall see errors like the
|
/etc/cloud/clean.d/README file. Otherwise, we shall see errors like the
|
||||||
following during the build process:
|
following during the build process:
|
||||||
|
|
||||||
`error: File not found: /builddir/build/.../etc/cloud/clean.d/README`
|
error: File not found: /builddir/build/.../etc/cloud/clean.d/README
|
||||||
|
|
||||||
After a rebase, we can only maintain the downstream spec file change as
|
After a rebase, we can only maintain the downstream spec file change as
|
||||||
the rest of it is clean cherry-pick from upstream.
|
the rest of it is clean cherry-pick from upstream.
|
||||||
@ -127,6 +119,3 @@ index 62a9129b..fae3c12b 100644
|
|||||||
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
|
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
|
||||||
%dir %{_sysconfdir}/cloud/cloud.cfg.d
|
%dir %{_sysconfdir}/cloud/cloud.cfg.d
|
||||||
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
|
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,98 +0,0 @@
|
|||||||
From 77585bbc6d01399ff88865b55dfb7a47b8640271 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
Date: Thu, 20 May 2021 08:53:55 +0200
|
|
||||||
Subject: rhel/cloud.cfg: remove ssh_genkeytypes in settings.py and set in
|
|
||||||
cloud.cfg
|
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 113: rhel/cloud.cfg: remove ssh_genkeytypes in settings.py and set in cloud.cfg
|
|
||||||
RH-Jira: RHEL-16572
|
|
||||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Commit: [1/1] f506bf58dc5458f50624342ec33bcd390aa0b719 (anisinha/rhel-cloud-init)
|
|
||||||
|
|
||||||
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-MergeRequest: 10: rhel/cloud.cfg: remove ssh_genkeytypes in settings.py and set in cloud.cfg
|
|
||||||
RH-Commit: [1/1] 6da989423b9b6e017afbac2f1af3649b0487310f
|
|
||||||
RH-Bugzilla: 1957532
|
|
||||||
RH-Acked-by: Eduardo Otubo <otubo@redhat.com>
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
||||||
RH-Acked-by: Mohamed Gamal Morsy <mmorsy@redhat.com>
|
|
||||||
|
|
||||||
Currently genkeytypes in cloud.cfg is set to None, so together with
|
|
||||||
ssh_deletekeys=1 cloudinit on first boot it will just delete the existing
|
|
||||||
keys and not generate new ones.
|
|
||||||
|
|
||||||
Just removing that property in cloud.cfg is not enough, because
|
|
||||||
settings.py provides another empty default value that will be used
|
|
||||||
instead, resulting to no key generated even when the property is not defined.
|
|
||||||
|
|
||||||
Removing genkeytypes also in settings.py will default to GENERATE_KEY_NAMES,
|
|
||||||
but since we want only 'rsa', 'ecdsa' and 'ed25519', add back genkeytypes in
|
|
||||||
cloud.cfg with the above defaults.
|
|
||||||
|
|
||||||
Also remove ssh_deletekeys in settings.py as we always need
|
|
||||||
to 1 (and it also defaults to 1).
|
|
||||||
|
|
||||||
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
(cherry picked from commit b545a0cbabe8924d048b7172b30e7aad59ed32d5)
|
|
||||||
(cherry picked from commit 855dec5dcc0892c0f7cedf06b025a794769a2a8d)
|
|
||||||
|
|
||||||
Fix unit test breakage
|
|
||||||
|
|
||||||
Fix unit test breakage due to the downstream change
|
|
||||||
5d6674508c6478fa2c ("rhel/cloud.cfg: remove ssh_genkeytypes in settings.py and set in cloud.cfg")
|
|
||||||
|
|
||||||
X-downstream-only: true
|
|
||||||
Fixes: 5d6674508c6478fa2c ("rhel/cloud.cfg: remove ssh_genkeytypes in settings.py and set in cloud.cfg")
|
|
||||||
|
|
||||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
|
|
||||||
Squashed:
|
|
||||||
commit 1afec9e6008db187d1b675e4473d5a2bf0b3c36b
|
|
||||||
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
Date: Thu May 20 08:53:55 2021 +0200
|
|
||||||
Subject: [PATCH 49/51] rhel/cloud.cfg: remove ssh_genkeytypes in settings.py
|
|
||||||
and set in cloud.cfg
|
|
||||||
|
|
||||||
From fe6fb1843fe8df75899fe189b9e5f8ce3cd75be1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
|
||||||
Date: Fri, 8 Dec 2023 12:50:15 +0530
|
|
||||||
Subject: [PATCH 51/51] Fix unit test breakage
|
|
||||||
|
|
||||||
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
---
|
|
||||||
cloudinit/settings.py | 2 --
|
|
||||||
tests/unittests/cmd/test_main.py | 2 --
|
|
||||||
2 files changed, 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
|
|
||||||
index 87829ff0..3a581e5b 100644
|
|
||||||
--- a/cloudinit/settings.py
|
|
||||||
+++ b/cloudinit/settings.py
|
|
||||||
@@ -56,8 +56,6 @@ CFG_BUILTIN = {
|
|
||||||
"log_cfgs": [],
|
|
||||||
"syslog_fix_perms": [],
|
|
||||||
"mount_default_fields": [None, None, "auto", "defaults,nofail", "0", "2"],
|
|
||||||
- "ssh_deletekeys": False,
|
|
||||||
- "ssh_genkeytypes": [],
|
|
||||||
"system_info": {
|
|
||||||
"paths": {
|
|
||||||
"cloud_dir": "/var/lib/cloud",
|
|
||||||
diff --git a/tests/unittests/cmd/test_main.py b/tests/unittests/cmd/test_main.py
|
|
||||||
index c8c2ae81..19d26ebe 100644
|
|
||||||
--- a/tests/unittests/cmd/test_main.py
|
|
||||||
+++ b/tests/unittests/cmd/test_main.py
|
|
||||||
@@ -122,8 +122,6 @@ class TestMain(FilesystemMockingTestCase):
|
|
||||||
"vendor_data": {"enabled": True, "prefix": []},
|
|
||||||
"vendor_data2": {"enabled": True, "prefix": []},
|
|
||||||
"syslog_fix_perms": [],
|
|
||||||
- "ssh_deletekeys": False,
|
|
||||||
- "ssh_genkeytypes": [],
|
|
||||||
"mount_default_fields": [
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,20 +1,13 @@
|
|||||||
From 3f138f68a36224dcefd5c16befbc00486b09c8ec Mon Sep 17 00:00:00 2001
|
From 7f3b0ff968409a880596e04aece4e4c504fb9c64 Mon Sep 17 00:00:00 2001
|
||||||
From: Brett Holman <brett.holman@canonical.com>
|
From: Brett Holman <brett.holman@canonical.com>
|
||||||
Date: Mon, 29 Jan 2024 12:03:36 -0700
|
Date: Mon, 29 Jan 2024 12:03:36 -0700
|
||||||
Subject: [PATCH 1/2] ci: Pin pytest<8.0.0. (#4816)
|
Subject: [PATCH] ci: Pin pytest<8.0.0. (#4816)
|
||||||
|
|
||||||
RH-Author: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-MergeRequest: 123: fix: Add types to network v1 schema (#4841)
|
|
||||||
RH-Jira: RHEL-21323
|
|
||||||
RH-Acked-by: Ani Sinha <None>
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Commit: [1/2] db0348f73893a7bb536e4a3562dc7ef33b2590ad
|
|
||||||
|
|
||||||
The latest pytest release broke some tests in non-obvious ways. Pin
|
The latest pytest release broke some tests in non-obvious ways. Pin
|
||||||
the version for now so that CI passes.
|
the version for now so that CI passes.
|
||||||
|
|
||||||
(cherry picked from commit 7c96c9cd9318e816ce4564b58a2c98271363c447)
|
(cherry picked from commit 7c96c9cd9318e816ce4564b58a2c98271363c447)
|
||||||
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
||||||
---
|
---
|
||||||
integration-requirements.txt | 2 +-
|
integration-requirements.txt | 2 +-
|
||||||
test-requirements.txt | 2 +-
|
test-requirements.txt | 2 +-
|
@ -1,14 +1,14 @@
|
|||||||
From 9da40a7e46e40eb090538f9d8a5aa6049fbbc5b8 Mon Sep 17 00:00:00 2001
|
From cc31dc321ae35995ceff93e67aaf0b0c660aa890 Mon Sep 17 00:00:00 2001
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
Date: Tue, 12 Mar 2024 12:52:10 +0530
|
Date: Tue, 12 Mar 2024 12:52:10 +0530
|
||||||
Subject: [PATCH] Retain exit code in cloud-init status for recoverable errors
|
Subject: [PATCH] Retain exit code in cloud-init status for recoverable errors
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
RH-Author: Ani Sinha <None>
|
||||||
RH-MergeRequest: 126: Retain exit code in cloud-init status for recoverable errors
|
RH-MergeRequest: 71: Retain exit code in cloud-init status for recoverable errors
|
||||||
RH-Jira: RHEL-28817
|
RH-Jira: RHEL-28549
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||||
RH-Commit: [1/1] 8c45ffe77ed8e964c35af4705d65daaf8282038f
|
RH-Commit: [1/1] 00934ade88c481c012bc1947fa44e5ed59f82858 (anisinha/cloud-init)
|
||||||
|
|
||||||
Version 23.4 of cloud-init changed the status code reported by cloud-init for
|
Version 23.4 of cloud-init changed the status code reported by cloud-init for
|
||||||
recoverable errors from 0 to 2. Please see the commit
|
recoverable errors from 0 to 2. Please see the commit
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
From ce17b057e4bd5dfaa2cc72991736a1b82704488c Mon Sep 17 00:00:00 2001
|
From 72b2deeafd9276d15f20831f01b2f8c44616f33d Mon Sep 17 00:00:00 2001
|
||||||
From: Brett Holman <brett.holman@canonical.com>
|
From: Brett Holman <brett.holman@canonical.com>
|
||||||
Date: Tue, 23 Jan 2024 11:47:35 -0700
|
Date: Tue, 23 Jan 2024 11:47:35 -0700
|
||||||
Subject: [PATCH] Revert "Use grep for faster parsing of cloud config in
|
Subject: [PATCH] Revert "Use grep for faster parsing of cloud config in
|
||||||
ds-identify (#4327)"
|
ds-identify (#4327)"
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
RH-Author: Ani Sinha <None>
|
||||||
RH-MergeRequest: 122: Revert "Use grep for faster parsing of cloud config in ds-identify (#4327)"
|
RH-MergeRequest: 67: Revert "Use grep for faster parsing of cloud config in ds-identify (#4327)"
|
||||||
RH-Jira: RHEL-22248
|
RH-Jira: RHEL-22255
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
RH-Commit: [1/1] f14ebd0055aad9340249e83381cf976debdbe38d
|
RH-Commit: [1/1] 5997598254cd16ea7f26d87212b0f09920fcdf50 (anisinha/cloud-init)
|
||||||
|
|
||||||
This reverts commit 816e05d4830f5e789f1f85ef926e2849156bff3a.
|
This reverts commit 816e05d4830f5e789f1f85ef926e2849156bff3a.
|
||||||
|
|
||||||
@ -238,5 +238,5 @@ index 7a537278..ec2cc18a 100755
|
|||||||
_RET="$ret"
|
_RET="$ret"
|
||||||
_RET_fname="$found_fn"
|
_RET_fname="$found_fn"
|
||||||
--
|
--
|
||||||
2.41.0
|
2.39.3
|
||||||
|
|
||||||
|
@ -1,108 +0,0 @@
|
|||||||
From 42aad98557bb62ae693f38e5f1e137bcc44f6046 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
|
||||||
Date: Tue, 5 Mar 2024 12:42:26 +0530
|
|
||||||
Subject: [PATCH] Revert "systemd: Standardize cloud-init systemd enablement
|
|
||||||
(#4399)"
|
|
||||||
|
|
||||||
RH-Author: Ani Sinha <None>
|
|
||||||
RH-MergeRequest: 124: Revert "systemd: Standardize cloud-init systemd enablement (#4399)"
|
|
||||||
RH-Jira: RHEL-21290
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Commit: [1/1] 10da53e761e25ff7d254a4cfb8fb1fd18de8b4ed
|
|
||||||
|
|
||||||
This reverts commit ec7dde8041d4023b09324e84abe37dc766ebbaf6.
|
|
||||||
|
|
||||||
'ConditionEnvironment' clause is not available in RHEL 8.10 systemd and adding
|
|
||||||
the feature would be complicated. Hence reverting the patch seems to be the
|
|
||||||
right thing to do as it was a simple enhancement to make sure all distros use
|
|
||||||
systemd's kernel commandline and file conditionals. We only care about RHEL so
|
|
||||||
the change should not affect us.
|
|
||||||
|
|
||||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
---
|
|
||||||
systemd/cloud-config.service.tmpl | 3 ++-
|
|
||||||
systemd/cloud-final.service.tmpl | 3 ++-
|
|
||||||
systemd/cloud-init-local.service.tmpl | 3 ++-
|
|
||||||
systemd/cloud-init.service.tmpl | 3 ++-
|
|
||||||
systemd/cloud-init.target | 3 ---
|
|
||||||
5 files changed, 8 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/systemd/cloud-config.service.tmpl b/systemd/cloud-config.service.tmpl
|
|
||||||
index 31d9d983..76e50ae1 100644
|
|
||||||
--- a/systemd/cloud-config.service.tmpl
|
|
||||||
+++ b/systemd/cloud-config.service.tmpl
|
|
||||||
@@ -5,9 +5,10 @@ After=network-online.target cloud-config.target
|
|
||||||
After=snapd.seeded.service
|
|
||||||
Before=systemd-user-sessions.service
|
|
||||||
Wants=network-online.target cloud-config.target
|
|
||||||
+{% if variant == "rhel" %}
|
|
||||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
||||||
ConditionKernelCommandLine=!cloud-init=disabled
|
|
||||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
|
||||||
+{% endif %}
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl
|
|
||||||
index bcf8b009..85f423ac 100644
|
|
||||||
--- a/systemd/cloud-final.service.tmpl
|
|
||||||
+++ b/systemd/cloud-final.service.tmpl
|
|
||||||
@@ -7,9 +7,10 @@ After=multi-user.target
|
|
||||||
Before=apt-daily.service
|
|
||||||
{% endif %}
|
|
||||||
Wants=network-online.target cloud-config.service
|
|
||||||
+{% if variant == "rhel" %}
|
|
||||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
||||||
ConditionKernelCommandLine=!cloud-init=disabled
|
|
||||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
|
||||||
+{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl
|
|
||||||
index 3a1ca7fa..6f3f9d8d 100644
|
|
||||||
--- a/systemd/cloud-init-local.service.tmpl
|
|
||||||
+++ b/systemd/cloud-init-local.service.tmpl
|
|
||||||
@@ -26,9 +26,10 @@ Before=sysinit.target
|
|
||||||
Conflicts=shutdown.target
|
|
||||||
{% endif %}
|
|
||||||
RequiresMountsFor=/var/lib/cloud
|
|
||||||
+{% if variant == "rhel" %}
|
|
||||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
||||||
ConditionKernelCommandLine=!cloud-init=disabled
|
|
||||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
|
||||||
+{% endif %}
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
|
|
||||||
index bf91164a..26d2e39c 100644
|
|
||||||
--- a/systemd/cloud-init.service.tmpl
|
|
||||||
+++ b/systemd/cloud-init.service.tmpl
|
|
||||||
@@ -38,9 +38,10 @@ Conflicts=shutdown.target
|
|
||||||
Before=shutdown.target
|
|
||||||
Conflicts=shutdown.target
|
|
||||||
{% endif %}
|
|
||||||
+{% if variant == "rhel" %}
|
|
||||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
||||||
ConditionKernelCommandLine=!cloud-init=disabled
|
|
||||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
|
||||||
+{% endif %}
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
diff --git a/systemd/cloud-init.target b/systemd/cloud-init.target
|
|
||||||
index 30450f7f..760dfee5 100644
|
|
||||||
--- a/systemd/cloud-init.target
|
|
||||||
+++ b/systemd/cloud-init.target
|
|
||||||
@@ -10,6 +10,3 @@
|
|
||||||
[Unit]
|
|
||||||
Description=Cloud-init target
|
|
||||||
After=multi-user.target
|
|
||||||
-ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
|
||||||
-ConditionKernelCommandLine=!cloud-init=disabled
|
|
||||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
|
||||||
--
|
|
||||||
2.39.3
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
|||||||
From 1024e43b58ce84bb6c6d8bd89785704e04560b2a Mon Sep 17 00:00:00 2001
|
From c21351ad9da5aebcb252aa36cbfa92ac16fa9746 Mon Sep 17 00:00:00 2001
|
||||||
From: Florian Apolloner <florian@apolloner.eu>
|
From: Florian Apolloner <florian@apolloner.eu>
|
||||||
Date: Fri, 5 Jan 2024 19:07:12 +0100
|
Date: Fri, 5 Jan 2024 19:07:12 +0100
|
||||||
Subject: [PATCH 2/3] feat: apply global DNS to interfaces in network-manager
|
Subject: [PATCH 2/3] feat: apply global DNS to interfaces in network-manager
|
||||||
(#4723)
|
(#4723)
|
||||||
|
|
||||||
RH-Author: Cathy Avery <cavery@redhat.com>
|
RH-Author: Cathy Avery <cavery@redhat.com>
|
||||||
RH-MergeRequest: 128: Fixes for cloud-init fails to configure DNS/search domains for network-config v1
|
RH-MergeRequest: 72: Fixes for cloud-init fails to configure DNS/search domains for network-config v1
|
||||||
RH-Jira: RHEL-27134
|
RH-Jira: RHEL-20964
|
||||||
RH-Acked-by: Ani Sinha <anisinha@redhat.com>
|
RH-Acked-by: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Commit: [2/2] 73d27116735e853fbaa38942390721dd78bc6241
|
RH-Commit: [2/2] 1d2b10133ec2558e9665f21f53e4b1a898e283a8 (cavery/cloud-init-c-9-s)
|
||||||
|
|
||||||
Sometimes DNS settings in cloud configs are specified globally and
|
Sometimes DNS settings in cloud configs are specified globally and
|
||||||
not per interface / subnet. This results in a configuration without
|
not per interface / subnet. This results in a configuration without
|
||||||
@ -128,10 +128,10 @@ index 06feab89..f340ffc1 100644
|
|||||||
network_config = safeyaml.load(
|
network_config = safeyaml.load(
|
||||||
Path(ARTIFACT_DIR, f"{test_name}.yaml").read_text()
|
Path(ARTIFACT_DIR, f"{test_name}.yaml").read_text()
|
||||||
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 678ec39b..e010eb6b 100644
|
index 2a99f150..d7c9a414 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
|
||||||
@@ -645,6 +645,7 @@ method=manual
|
@@ -646,6 +646,7 @@ method=manual
|
||||||
may-fail=false
|
may-fail=false
|
||||||
address1=172.19.1.34/22
|
address1=172.19.1.34/22
|
||||||
route1=0.0.0.0/0,172.19.3.254
|
route1=0.0.0.0/0,172.19.3.254
|
||||||
@ -139,7 +139,7 @@ index 678ec39b..e010eb6b 100644
|
|||||||
|
|
||||||
""".lstrip(),
|
""".lstrip(),
|
||||||
),
|
),
|
||||||
@@ -2769,6 +2770,8 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
@@ -2797,6 +2798,8 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
[ipv4]
|
[ipv4]
|
||||||
method=auto
|
method=auto
|
||||||
may-fail=false
|
may-fail=false
|
||||||
@ -148,7 +148,7 @@ index 678ec39b..e010eb6b 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -2794,6 +2797,8 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
@@ -2822,6 +2825,8 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
method=manual
|
method=manual
|
||||||
may-fail=false
|
may-fail=false
|
||||||
address1=192.168.200.7/24
|
address1=192.168.200.7/24
|
||||||
@ -157,7 +157,7 @@ index 678ec39b..e010eb6b 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -2818,6 +2823,8 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
@@ -2846,6 +2851,8 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
[ipv4]
|
[ipv4]
|
||||||
method=auto
|
method=auto
|
||||||
may-fail=false
|
may-fail=false
|
||||||
@ -166,7 +166,7 @@ index 678ec39b..e010eb6b 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -2902,12 +2909,15 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
@@ -2930,12 +2937,15 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
method=manual
|
method=manual
|
||||||
may-fail=false
|
may-fail=false
|
||||||
address1=192.168.14.2/24
|
address1=192.168.14.2/24
|
||||||
@ -182,7 +182,7 @@ index 678ec39b..e010eb6b 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -2962,6 +2972,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
@@ -2990,6 +3000,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
[ipv6]
|
[ipv6]
|
||||||
method=auto
|
method=auto
|
||||||
may-fail=false
|
may-fail=false
|
||||||
@ -203,5 +203,5 @@ index dbdb9cfa..f4da0989 100644
|
|||||||
bdrung
|
bdrung
|
||||||
beantaxi
|
beantaxi
|
||||||
--
|
--
|
||||||
2.41.0
|
2.39.3
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
From 773501c6d2b52a5623b5fed3c5534d41aa6488fa Mon Sep 17 00:00:00 2001
|
From 6b32b371bfd37759ddce3d7f29d15546500698e6 Mon Sep 17 00:00:00 2001
|
||||||
From: Ani Sinha <anisinha@redhat.com>
|
From: Ani Sinha <anisinha@redhat.com>
|
||||||
Date: Thu, 20 Jun 2024 22:27:03 +0530
|
Date: Thu, 20 Jun 2024 22:27:03 +0530
|
||||||
Subject: [PATCH] feat(sysconfig): Add DNS from interface config to resolv.conf
|
Subject: [PATCH 1/6] feat(sysconfig): Add DNS from interface config to
|
||||||
(#5401)
|
resolv.conf (#5401)
|
||||||
|
|
||||||
RH-Author: xiachen <xiachen@redhat.com>
|
RH-Author: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-MergeRequest: 140: feat(sysconfig): Add DNS from interface config to resolv.conf (#5401)
|
RH-MergeRequest: 88: feat(sysconfig): Add DNS from interface config to resolv.conf (#5401)
|
||||||
RH-Jira: RHEL-46013
|
RH-Jira: RHEL-17961
|
||||||
RH-Acked-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Commit: [1/1] b9f492627cdae3bf356f388eb0870241793a7f99
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
|
RH-Commit: [1/1] f353b73cc0f4bb9e1aee037708a1d3cb23b83cc3 (anisinha/cloud-init)
|
||||||
|
|
||||||
sysconfig renderer currently only uses global dns and search domain
|
sysconfig renderer currently only uses global dns and search domain
|
||||||
configuration in order to populate /etc/resolv.conf. This means it ignores
|
configuration in order to populate /etc/resolv.conf. This means it ignores
|
||||||
@ -25,14 +25,14 @@ Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|||||||
(cherry picked from commit 1b8030e0c7fd6fbff7e38ad1e3e6266ae50c83a5)
|
(cherry picked from commit 1b8030e0c7fd6fbff7e38ad1e3e6266ae50c83a5)
|
||||||
---
|
---
|
||||||
cloudinit/net/sysconfig.py | 52 +++++++++-
|
cloudinit/net/sysconfig.py | 52 +++++++++-
|
||||||
tests/unittests/test_net.py | 183 +++++++++++++++++++++++++++++++++++-
|
tests/unittests/test_net.py | 184 +++++++++++++++++++++++++++++++++++-
|
||||||
2 files changed, 229 insertions(+), 6 deletions(-)
|
2 files changed, 230 insertions(+), 6 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 f01c4236..42eb2be3 100644
|
index d39f4fe3..7eb430ed 100644
|
||||||
--- a/cloudinit/net/sysconfig.py
|
--- a/cloudinit/net/sysconfig.py
|
||||||
+++ b/cloudinit/net/sysconfig.py
|
+++ b/cloudinit/net/sysconfig.py
|
||||||
@@ -824,20 +824,62 @@ class Renderer(renderer.Renderer):
|
@@ -825,20 +825,62 @@ class Renderer(renderer.Renderer):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _render_dns(network_state, existing_dns_path=None):
|
def _render_dns(network_state, existing_dns_path=None):
|
||||||
@ -101,7 +101,7 @@ index f01c4236..42eb2be3 100644
|
|||||||
header = _make_header(";")
|
header = _make_header(";")
|
||||||
content_str = str(content)
|
content_str = str(content)
|
||||||
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 e010eb6b..86ba398d 100644
|
index d7c9a414..2d716f4b 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
|
||||||
@@ -516,6 +516,8 @@ OS_SAMPLES = [
|
@@ -516,6 +516,8 @@ OS_SAMPLES = [
|
||||||
@ -123,7 +123,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
""".lstrip(),
|
""".lstrip(),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@@ -581,6 +585,8 @@ dns = none
|
@@ -582,6 +586,8 @@ AUTOCONNECT_PRIORITY=120
|
||||||
BOOTPROTO=none
|
BOOTPROTO=none
|
||||||
DEFROUTE=yes
|
DEFROUTE=yes
|
||||||
DEVICE=eth0
|
DEVICE=eth0
|
||||||
@ -132,7 +132,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
GATEWAY=172.19.3.254
|
GATEWAY=172.19.3.254
|
||||||
HWADDR=fa:16:3e:ed:9a:59
|
HWADDR=fa:16:3e:ed:9a:59
|
||||||
IPADDR=172.19.1.34
|
IPADDR=172.19.1.34
|
||||||
@@ -595,7 +601,173 @@ USERCTL=no
|
@@ -596,7 +602,174 @@ USERCTL=no
|
||||||
"""
|
"""
|
||||||
; Created by cloud-init automatically, do not edit.
|
; Created by cloud-init automatically, do not edit.
|
||||||
;
|
;
|
||||||
@ -282,6 +282,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
+ """
|
+ """
|
||||||
+# Created by cloud-init automatically, do not edit.
|
+# Created by cloud-init automatically, do not edit.
|
||||||
+#
|
+#
|
||||||
|
+AUTOCONNECT_PRIORITY=120
|
||||||
+BOOTPROTO=none
|
+BOOTPROTO=none
|
||||||
+DEFROUTE=yes
|
+DEFROUTE=yes
|
||||||
+DEVICE=eth0
|
+DEVICE=eth0
|
||||||
@ -306,7 +307,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
""".lstrip(),
|
""".lstrip(),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@@ -646,6 +818,7 @@ may-fail=false
|
@@ -647,6 +820,7 @@ may-fail=false
|
||||||
address1=172.19.1.34/22
|
address1=172.19.1.34/22
|
||||||
route1=0.0.0.0/0,172.19.3.254
|
route1=0.0.0.0/0,172.19.3.254
|
||||||
dns=172.19.0.12;
|
dns=172.19.0.12;
|
||||||
@ -314,7 +315,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
|
|
||||||
""".lstrip(),
|
""".lstrip(),
|
||||||
),
|
),
|
||||||
@@ -653,7 +826,13 @@ dns=172.19.0.12;
|
@@ -654,7 +828,13 @@ dns=172.19.0.12;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"in_data": {
|
"in_data": {
|
||||||
@ -329,7 +330,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
"networks": [
|
"networks": [
|
||||||
{
|
{
|
||||||
"network_id": "public-ipv4",
|
"network_id": "public-ipv4",
|
||||||
@@ -714,6 +893,7 @@ STARTMODE=auto
|
@@ -715,6 +895,7 @@ STARTMODE=auto
|
||||||
; Created by cloud-init automatically, do not edit.
|
; Created by cloud-init automatically, do not edit.
|
||||||
;
|
;
|
||||||
nameserver 172.19.0.12
|
nameserver 172.19.0.12
|
||||||
@ -337,7 +338,7 @@ index e010eb6b..86ba398d 100644
|
|||||||
""".lstrip(),
|
""".lstrip(),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@@ -761,6 +941,7 @@ USERCTL=no
|
@@ -763,6 +944,7 @@ USERCTL=no
|
||||||
; Created by cloud-init automatically, do not edit.
|
; Created by cloud-init automatically, do not edit.
|
||||||
;
|
;
|
||||||
nameserver 172.19.0.12
|
nameserver 172.19.0.12
|
||||||
@ -346,5 +347,5 @@ index e010eb6b..86ba398d 100644
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
--
|
--
|
||||||
2.45.1
|
2.39.3
|
||||||
|
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
From b424877c0e7673466e7bd354c1eed4db908ebab3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: James Falcon <james.falcon@canonical.com>
|
|
||||||
Date: Thu, 18 Apr 2024 20:27:27 -0500
|
|
||||||
Subject: [PATCH] fix: Add subnet ipv4/ipv6 to network schema (#5191)
|
|
||||||
|
|
||||||
RH-Author: Ani Sinha <anisinha@redhat.com>
|
|
||||||
RH-MergeRequest: 143: fix: Add subnet ipv4/ipv6 to network schema (#5191)
|
|
||||||
RH-Jira: RHEL-54155
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
||||||
RH-Commit: [1/1] d4c7beb80b8c67df6b6fc04db8d3b93ed82dd067
|
|
||||||
|
|
||||||
These are used by our openstack network_data.json parsing code and
|
|
||||||
get used by the sysconfig renderer.
|
|
||||||
|
|
||||||
Fixes GH-4911
|
|
||||||
|
|
||||||
(cherry picked from commit 0b1ca174095e3ad685e6d6649bb08aafb19a95b9)
|
|
||||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
---
|
|
||||||
cloudinit/config/schemas/schema-network-config-v1.json | 8 ++++++++
|
|
||||||
1 file changed, 8 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/cloudinit/config/schemas/schema-network-config-v1.json b/cloudinit/config/schemas/schema-network-config-v1.json
|
|
||||||
index 64c492a4..f485c784 100644
|
|
||||||
--- a/cloudinit/config/schemas/schema-network-config-v1.json
|
|
||||||
+++ b/cloudinit/config/schemas/schema-network-config-v1.json
|
|
||||||
@@ -523,6 +523,14 @@
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/$defs/anyOf_type_route"
|
|
||||||
}
|
|
||||||
+ },
|
|
||||||
+ "ipv4": {
|
|
||||||
+ "type": "boolean",
|
|
||||||
+ "description": "Indicate if the subnet is IPv4. If not specified, it will be inferred from the subnet type or address. This exists for compatibility with OpenStack's ``network_data.json`` when rendered through sysconfig."
|
|
||||||
+ },
|
|
||||||
+ "ipv6": {
|
|
||||||
+ "type": "boolean",
|
|
||||||
+ "description": "Indicate if the subnet is IPv6. If not specified, it will be inferred from the subnet type or address. This is exists for compatibility with OpenStack's ``network_data.json`` when rendered through sysconfig."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
--
|
|
||||||
2.45.1
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
|||||||
From 720faf533832ba758dcc8436f144168996508c2a Mon Sep 17 00:00:00 2001
|
From 2f7f3dc6237ea70825dcb70f71d9718f631a9d95 Mon Sep 17 00:00:00 2001
|
||||||
From: James Falcon <james.falcon@canonical.com>
|
From: James Falcon <james.falcon@canonical.com>
|
||||||
Date: Tue, 6 Feb 2024 09:24:37 -0600
|
Date: Tue, 6 Feb 2024 09:24:37 -0600
|
||||||
Subject: [PATCH 2/2] fix: Add types to network v1 schema (#4841)
|
Subject: [PATCH] fix: Add types to network v1 schema (#4841)
|
||||||
|
|
||||||
RH-Author: Cathy Avery <cavery@redhat.com>
|
RH-Author: Cathy Avery <cavery@redhat.com>
|
||||||
RH-MergeRequest: 123: fix: Add types to network v1 schema (#4841)
|
RH-MergeRequest: 69: fix: Add types to network v1 schema (#4841)
|
||||||
RH-Jira: RHEL-21323
|
RH-Jira: RHEL-21324
|
||||||
RH-Acked-by: Ani Sinha <None>
|
RH-Acked-by: Ani Sinha <None>
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Commit: [2/2] a73a68dff5a6ef54dc4e3b3527fc778400a461cc
|
RH-Commit: [1/1] 59b2b4b07dd9eed956943a22b90af487f18b4cbd (cavery/cloud-init-c-9-s)
|
||||||
|
|
||||||
Conflicts:
|
Conflicts:
|
||||||
For RHEL no log argument as we are not including commit e168b4a1383b6eae9c1dc81411d7684fcbbf7df9
|
No log argument as we are not including commit e168b4a1383b6eae9c1dc81411d7684fcbbf7df9
|
||||||
|
|
||||||
Even though it has conflicted with our documentation, we have allowed
|
Even though it has conflicted with our documentation, we have allowed
|
||||||
nameserver address to a be a string, mtu to be empty, and nameserver
|
nameserver address to a be a string, mtu to be empty, and nameserver
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
From 4e5b1ed68014b81ca2ef2f07675f2a43cf03c5c3 Mon Sep 17 00:00:00 2001
|
From 62cec1e38e117fe6b24888862576ac57be14bbda Mon Sep 17 00:00:00 2001
|
||||||
From: James Falcon <james.falcon@canonical.com>
|
From: James Falcon <james.falcon@canonical.com>
|
||||||
Date: Tue, 26 Mar 2024 15:55:50 -0500
|
Date: Tue, 26 Mar 2024 15:55:50 -0500
|
||||||
Subject: [PATCH] fix: Always use single datasource if specified (#5098)
|
Subject: [PATCH] fix: Always use single datasource if specified (#5098)
|
||||||
|
|
||||||
RH-Author: Ani Sinha <anisinha@redhat.com>
|
RH-Author: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-MergeRequest: 135: fix: Always use single datasource if specified (#5098)
|
RH-MergeRequest: 82: fix: Always use single datasource if specified (#5098)
|
||||||
RH-Jira: RHEL-36701
|
RH-Jira: RHEL-36255
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||||
RH-Commit: [1/1] 491f053f7d758f1a0ca8918d1449cc2f7838291f
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
|
RH-Commit: [1/1] 068e97fcc18dd99f1112a9109acdb30fe2880f6e (anisinha/cloud-init)
|
||||||
|
|
||||||
This change may require a user to add `None` to the `datasource_list`
|
This change may require a user to add `None` to the `datasource_list`
|
||||||
defined in `/etc/cloud/cloud.cfg[.d]` if they have a customized
|
defined in `/etc/cloud/cloud.cfg[.d]` if they have a customized
|
||||||
@ -62,5 +62,5 @@ index ec2cc18a..6e49ded3 100755
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
--
|
--
|
||||||
2.45.1
|
2.39.3
|
||||||
|
|
||||||
|
@ -1,247 +0,0 @@
|
|||||||
From cfbe83d4a869ab20d385b5058031df0364483bda Mon Sep 17 00:00:00 2001
|
|
||||||
From: James Falcon <james.falcon@canonical.com>
|
|
||||||
Date: Thu, 18 Jul 2024 09:04:54 -0400
|
|
||||||
Subject: [PATCH] fix: Clean cache if no datasource fallback (#5499)
|
|
||||||
|
|
||||||
RH-Author: Ani Sinha <anisinha@redhat.com>
|
|
||||||
RH-MergeRequest: 141: fix: Clean cache if no datasource fallback (#5499)
|
|
||||||
RH-Jira: RHEL-49742
|
|
||||||
RH-Acked-by: xiachen <xiachen@redhat.com>
|
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
||||||
RH-Commit: [1/1] 64a79c1a6bd06c280aed85032bb55cc60ec1fc2e
|
|
||||||
|
|
||||||
9929a00 added the ability to used a cached datasource when none is
|
|
||||||
found. This was supposed to be per-datasource, but the lack of cache
|
|
||||||
cleaning got applied universally. This commit makes it so cache will be
|
|
||||||
cleaned as it was before if fallback isn't implemented in datasource.
|
|
||||||
|
|
||||||
Fixes GH-5486
|
|
||||||
|
|
||||||
(cherry picked from commit 550c685c98551f65c30832b186fe091721b48477)
|
|
||||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
||||||
---
|
|
||||||
cloudinit/stages.py | 1 +
|
|
||||||
.../assets/DataSourceNoCacheNetworkOnly.py | 23 ++++
|
|
||||||
.../assets/DataSourceNoCacheWithFallback.py | 29 +++++
|
|
||||||
.../datasources/test_caching.py | 115 ++++++++++++++++++
|
|
||||||
tests/integration_tests/instances.py | 4 +-
|
|
||||||
5 files changed, 171 insertions(+), 1 deletion(-)
|
|
||||||
create mode 100644 tests/integration_tests/assets/DataSourceNoCacheNetworkOnly.py
|
|
||||||
create mode 100644 tests/integration_tests/assets/DataSourceNoCacheWithFallback.py
|
|
||||||
create mode 100644 tests/integration_tests/datasources/test_caching.py
|
|
||||||
|
|
||||||
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
|
|
||||||
index 0b795624..ace94c9a 100644
|
|
||||||
--- a/cloudinit/stages.py
|
|
||||||
+++ b/cloudinit/stages.py
|
|
||||||
@@ -378,6 +378,7 @@ class Init:
|
|
||||||
ds,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
+ util.del_file(self.paths.instance_link)
|
|
||||||
raise e
|
|
||||||
self.datasource = ds
|
|
||||||
# Ensure we adjust our path members datasource
|
|
||||||
diff --git a/tests/integration_tests/assets/DataSourceNoCacheNetworkOnly.py b/tests/integration_tests/assets/DataSourceNoCacheNetworkOnly.py
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000..54a7bab3
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/integration_tests/assets/DataSourceNoCacheNetworkOnly.py
|
|
||||||
@@ -0,0 +1,23 @@
|
|
||||||
+import logging
|
|
||||||
+
|
|
||||||
+from cloudinit import sources
|
|
||||||
+
|
|
||||||
+LOG = logging.getLogger(__name__)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class DataSourceNoCacheNetworkOnly(sources.DataSource):
|
|
||||||
+ def _get_data(self):
|
|
||||||
+ LOG.debug("TEST _get_data called")
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+datasources = [
|
|
||||||
+ (
|
|
||||||
+ DataSourceNoCacheNetworkOnly,
|
|
||||||
+ (sources.DEP_FILESYSTEM, sources.DEP_NETWORK),
|
|
||||||
+ ),
|
|
||||||
+]
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def get_datasource_list(depends):
|
|
||||||
+ return sources.list_from_depends(depends, datasources)
|
|
||||||
diff --git a/tests/integration_tests/assets/DataSourceNoCacheWithFallback.py b/tests/integration_tests/assets/DataSourceNoCacheWithFallback.py
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000..fdfc473f
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/integration_tests/assets/DataSourceNoCacheWithFallback.py
|
|
||||||
@@ -0,0 +1,29 @@
|
|
||||||
+import logging
|
|
||||||
+import os
|
|
||||||
+
|
|
||||||
+from cloudinit import sources
|
|
||||||
+
|
|
||||||
+LOG = logging.getLogger(__name__)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class DataSourceNoCacheWithFallback(sources.DataSource):
|
|
||||||
+ def _get_data(self):
|
|
||||||
+ if os.path.exists("/ci-test-firstboot"):
|
|
||||||
+ LOG.debug("TEST _get_data called")
|
|
||||||
+ return True
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ def check_if_fallback_is_allowed(self):
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+datasources = [
|
|
||||||
+ (
|
|
||||||
+ DataSourceNoCacheWithFallback,
|
|
||||||
+ (sources.DEP_FILESYSTEM,),
|
|
||||||
+ ),
|
|
||||||
+]
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def get_datasource_list(depends):
|
|
||||||
+ return sources.list_from_depends(depends, datasources)
|
|
||||||
diff --git a/tests/integration_tests/datasources/test_caching.py b/tests/integration_tests/datasources/test_caching.py
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000..33e4b671
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/tests/integration_tests/datasources/test_caching.py
|
|
||||||
@@ -0,0 +1,115 @@
|
|
||||||
+import pytest
|
|
||||||
+
|
|
||||||
+from tests.integration_tests import releases, util
|
|
||||||
+from tests.integration_tests.instances import IntegrationInstance
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def setup_custom_datasource(client: IntegrationInstance, datasource_name: str):
|
|
||||||
+ client.write_to_file(
|
|
||||||
+ "/etc/cloud/cloud.cfg.d/99-imds.cfg",
|
|
||||||
+ f"datasource_list: [ {datasource_name}, None ]\n"
|
|
||||||
+ "datasource_pkg_list: [ cisources ]",
|
|
||||||
+ )
|
|
||||||
+ assert client.execute(
|
|
||||||
+ "mkdir -p /usr/lib/python3/dist-packages/cisources"
|
|
||||||
+ )
|
|
||||||
+ client.push_file(
|
|
||||||
+ util.ASSETS_DIR / f"DataSource{datasource_name}.py",
|
|
||||||
+ "/usr/lib/python3/dist-packages/cisources/"
|
|
||||||
+ f"DataSource{datasource_name}.py",
|
|
||||||
+ )
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def verify_no_cache_boot(client: IntegrationInstance):
|
|
||||||
+ log = client.read_from_file("/var/log/cloud-init.log")
|
|
||||||
+ util.verify_ordered_items_in_text(
|
|
||||||
+ [
|
|
||||||
+ "No local datasource found",
|
|
||||||
+ "running 'init'",
|
|
||||||
+ "no cache found",
|
|
||||||
+ "Detected platform",
|
|
||||||
+ "TEST _get_data called",
|
|
||||||
+ ],
|
|
||||||
+ text=log,
|
|
||||||
+ )
|
|
||||||
+ util.verify_clean_boot(client)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+@pytest.mark.skipif(
|
|
||||||
+ not releases.IS_UBUNTU,
|
|
||||||
+ reason="hardcoded dist-packages directory",
|
|
||||||
+)
|
|
||||||
+def test_no_cache_network_only(client: IntegrationInstance):
|
|
||||||
+ """Test cache removal per boot. GH-5486
|
|
||||||
+
|
|
||||||
+ This tests the CloudStack password reset use case. The expectation is:
|
|
||||||
+ - Metadata is fetched in network timeframe only
|
|
||||||
+ - Because `check_instance_id` is not defined, no cached datasource
|
|
||||||
+ is found in the init-local phase, but the cache is used in the
|
|
||||||
+ remaining phases due to existance of /run/cloud-init/.instance-id
|
|
||||||
+ - Because `check_if_fallback_is_allowed` is not defined, cloud-init
|
|
||||||
+ does NOT fall back to the pickled datasource, and will
|
|
||||||
+ instead delete the cache during the init-local phase
|
|
||||||
+ - Metadata is therefore fetched every boot in the network phase
|
|
||||||
+ """
|
|
||||||
+ setup_custom_datasource(client, "NoCacheNetworkOnly")
|
|
||||||
+
|
|
||||||
+ # Run cloud-init as if first boot
|
|
||||||
+ assert client.execute("cloud-init clean --logs")
|
|
||||||
+ client.restart()
|
|
||||||
+
|
|
||||||
+ verify_no_cache_boot(client)
|
|
||||||
+
|
|
||||||
+ # Clear the log without clean and run cloud-init for subsequent boot
|
|
||||||
+ assert client.execute("echo '' > /var/log/cloud-init.log")
|
|
||||||
+ client.restart()
|
|
||||||
+
|
|
||||||
+ verify_no_cache_boot(client)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+@pytest.mark.skipif(
|
|
||||||
+ not releases.IS_UBUNTU,
|
|
||||||
+ reason="hardcoded dist-packages directory",
|
|
||||||
+)
|
|
||||||
+def test_no_cache_with_fallback(client: IntegrationInstance):
|
|
||||||
+ """Test we use fallback when defined and no cache available."""
|
|
||||||
+ setup_custom_datasource(client, "NoCacheWithFallback")
|
|
||||||
+
|
|
||||||
+ # Run cloud-init as if first boot
|
|
||||||
+ assert client.execute("cloud-init clean --logs")
|
|
||||||
+ # Used by custom datasource
|
|
||||||
+ client.execute("touch /ci-test-firstboot")
|
|
||||||
+ client.restart()
|
|
||||||
+
|
|
||||||
+ log = client.read_from_file("/var/log/cloud-init.log")
|
|
||||||
+ util.verify_ordered_items_in_text(
|
|
||||||
+ [
|
|
||||||
+ "no cache found",
|
|
||||||
+ "Detected platform",
|
|
||||||
+ "TEST _get_data called",
|
|
||||||
+ "running 'init'",
|
|
||||||
+ "restored from cache with run check",
|
|
||||||
+ "running 'modules:config'",
|
|
||||||
+ ],
|
|
||||||
+ text=log,
|
|
||||||
+ )
|
|
||||||
+ util.verify_clean_boot(client)
|
|
||||||
+
|
|
||||||
+ # Clear the log without clean and run cloud-init for subsequent boot
|
|
||||||
+ assert client.execute("echo '' > /var/log/cloud-init.log")
|
|
||||||
+ client.execute("rm /ci-test-firstboot")
|
|
||||||
+ client.restart()
|
|
||||||
+
|
|
||||||
+ log = client.read_from_file("/var/log/cloud-init.log")
|
|
||||||
+ util.verify_ordered_items_in_text(
|
|
||||||
+ [
|
|
||||||
+ "cache invalid in datasource",
|
|
||||||
+ "Detected platform",
|
|
||||||
+ "Restored fallback datasource from checked cache",
|
|
||||||
+ "running 'init'",
|
|
||||||
+ "restored from cache with run check",
|
|
||||||
+ "running 'modules:config'",
|
|
||||||
+ ],
|
|
||||||
+ text=log,
|
|
||||||
+ )
|
|
||||||
+ util.verify_clean_boot(client)
|
|
||||||
diff --git a/tests/integration_tests/instances.py b/tests/integration_tests/instances.py
|
|
||||||
index 3fc6558a..23c0dc98 100644
|
|
||||||
--- a/tests/integration_tests/instances.py
|
|
||||||
+++ b/tests/integration_tests/instances.py
|
|
||||||
@@ -88,7 +88,9 @@ class IntegrationInstance:
|
|
||||||
# First push to a temporary directory because of permissions issues
|
|
||||||
tmp_path = _get_tmp_path()
|
|
||||||
self.instance.push_file(str(local_path), tmp_path)
|
|
||||||
- assert self.execute("mv {} {}".format(tmp_path, str(remote_path))).ok
|
|
||||||
+ assert self.execute(
|
|
||||||
+ "mv {} {}".format(tmp_path, str(remote_path))
|
|
||||||
+ ), f"Failed to push {tmp_path} to {remote_path}"
|
|
||||||
|
|
||||||
def read_from_file(self, remote_path) -> str:
|
|
||||||
result = self.execute("cat {}".format(remote_path))
|
|
||||||
--
|
|
||||||
2.39.3
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
|||||||
From 65207b6778fa97ff450a9200c28e4770c9128854 Mon Sep 17 00:00:00 2001
|
From aaf1d063f198ce09f0d539a85e1a1a2bb834520b Mon Sep 17 00:00:00 2001
|
||||||
From: James Falcon <james.falcon@canonical.com>
|
From: James Falcon <james.falcon@canonical.com>
|
||||||
Date: Tue, 2 Jan 2024 11:29:17 -0600
|
Date: Tue, 2 Jan 2024 11:29:17 -0600
|
||||||
Subject: [PATCH 1/3] fix: Correct v2 NetworkManager route rendering (#4637)
|
Subject: [PATCH 1/3] fix: Correct v2 NetworkManager route rendering (#4637)
|
||||||
|
|
||||||
RH-Author: Cathy Avery <cavery@redhat.com>
|
RH-Author: Cathy Avery <cavery@redhat.com>
|
||||||
RH-MergeRequest: 128: Fixes for cloud-init fails to configure DNS/search domains for network-config v1
|
RH-MergeRequest: 72: Fixes for cloud-init fails to configure DNS/search domains for network-config v1
|
||||||
RH-Jira: RHEL-27134
|
RH-Jira: RHEL-20964
|
||||||
RH-Acked-by: Ani Sinha <anisinha@redhat.com>
|
RH-Acked-by: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Commit: [1/2] abfebdde6b8b914d5a7de8853beca1fe206a5b23
|
RH-Commit: [1/2] fb865987dbcf506a674eb9798f9c06859539a696 (cavery/cloud-init-c-9-s)
|
||||||
|
|
||||||
fix: Correct v2 NetworkManager route rendering
|
fix: Correct v2 NetworkManager route rendering
|
||||||
|
|
||||||
@ -195,10 +195,10 @@ index 76a0ac15..bd6e6d75 100644
|
|||||||
# at the at the same time. This will make the network configuration
|
# at the at the same time. This will make the network configuration
|
||||||
# work only when both ipv4 and ipv6 dhcp succeeds. This may not be
|
# work only when both ipv4 and ipv6 dhcp succeeds. This may not be
|
||||||
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 e52c2497..678ec39b 100644
|
index d9ef493b..2a99f150 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
|
||||||
@@ -2934,9 +2934,9 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
@@ -2962,9 +2962,9 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
||||||
may-fail=false
|
may-fail=false
|
||||||
address1=192.168.0.2/24
|
address1=192.168.0.2/24
|
||||||
gateway=192.168.0.1
|
gateway=192.168.0.1
|
||||||
@ -209,7 +209,7 @@ index e52c2497..678ec39b 100644
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
@@ -4114,6 +4114,148 @@ iface bond0 inet6 static
|
@@ -4154,6 +4154,148 @@ iface bond0 inet6 static
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@ -358,7 +358,7 @@ index e52c2497..678ec39b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -6214,6 +6356,27 @@ class TestNetworkManagerRendering(CiTestCase):
|
@@ -6267,6 +6409,27 @@ class TestNetworkManagerRendering(CiTestCase):
|
||||||
entry[self.expected_name], self.expected_conf_d, found
|
entry[self.expected_name], self.expected_conf_d, found
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -387,5 +387,5 @@ index e52c2497..678ec39b 100644
|
|||||||
@mock.patch(
|
@mock.patch(
|
||||||
"cloudinit.net.is_openvswitch_internal_interface",
|
"cloudinit.net.is_openvswitch_internal_interface",
|
||||||
--
|
--
|
||||||
2.41.0
|
2.39.3
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
From d17e05b1709e3b7148e889512282603f7399c857 Mon Sep 17 00:00:00 2001
|
From cf35040b46abb66c7239d156bd92c7267d7c40f7 Mon Sep 17 00:00:00 2001
|
||||||
From: PengpengSun <40026211+PengpengSun@users.noreply.github.com>
|
From: PengpengSun <40026211+PengpengSun@users.noreply.github.com>
|
||||||
Date: Fri, 29 Mar 2024 22:39:13 +0800
|
Date: Fri, 29 Mar 2024 22:39:13 +0800
|
||||||
Subject: [PATCH] fix: Fall back to cached local ds if no valid ds found
|
Subject: [PATCH] fix: Fall back to cached local ds if no valid ds found
|
||||||
(#4997)
|
(#4997)
|
||||||
|
|
||||||
RH-Author: Ani Sinha <anisinha@redhat.com>
|
RH-Author: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-MergeRequest: 133: fix: Fall back to cached local ds if no valid ds found (#4997)
|
RH-MergeRequest: 75: fix: Fall back to cached local ds if no valid ds found (#4997)
|
||||||
RH-Jira: RHEL-32841
|
RH-Jira: RHEL-32846
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
RH-Commit: [1/1] df9c6fda66dee9622725ff2d52e64999796324b8
|
RH-Commit: [1/1] 408c41fd8009255d98c31210ef936f2e68dfde75 (anisinha/cloud-init)
|
||||||
|
|
||||||
Rebooting an instance which has finished VMware guest
|
Rebooting an instance which has finished VMware guest
|
||||||
customization with DataSourceVMware will load
|
customization with DataSourceVMware will load
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
From 8a83f1e6077cea9dc9ebc909e1332e15c8cbadac Mon Sep 17 00:00:00 2001
|
From 332bb23bcfde801edf792e6c629ec350be07b952 Mon Sep 17 00:00:00 2001
|
||||||
From: James Falcon <james.falcon@canonical.com>
|
From: James Falcon <james.falcon@canonical.com>
|
||||||
Date: Tue, 19 Mar 2024 14:24:11 -0500
|
Date: Tue, 19 Mar 2024 14:24:11 -0500
|
||||||
Subject: [PATCH 3/3] fix: Undeprecate 'network' in schema route definition
|
Subject: [PATCH 3/3] fix: Undeprecate 'network' in schema route definition
|
||||||
(#5072)
|
(#5072)
|
||||||
|
|
||||||
RH-Author: Ani Sinha <anisinha@redhat.com>
|
RH-Author: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-MergeRequest: 129: fix: Undeprecate 'network' in schema route definition (#5072)
|
RH-MergeRequest: 73: fix: Undeprecate 'network' in schema route definition (#5072)
|
||||||
RH-Jira: RHEL-29710
|
RH-Jira: RHEL-29709
|
||||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||||
RH-Commit: [1/1] c482c3e11720f01daa7b0d37035157b062b35213
|
RH-Commit: [1/1] 61c660be43fd25999bca0cfd66d7b2150fee5a14 (anisinha/cloud-init)
|
||||||
|
|
||||||
It is passed through to our v1 schema from OpenStack network_data.json
|
It is passed through to our v1 schema from OpenStack network_data.json
|
||||||
|
|
||||||
@ -38,5 +38,5 @@ index 56dc27c9..64c492a4 100644
|
|||||||
"destination": {
|
"destination": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
--
|
--
|
||||||
2.41.0
|
2.39.3
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
From 6e3c351b013dc2ac01035853229ffdfdafa3afa8 Mon Sep 17 00:00:00 2001
|
From fcaff2e02a07af587d8366f61df1685435e32288 Mon Sep 17 00:00:00 2001
|
||||||
From: Brett Holman <brett.holman@canonical.com>
|
From: Brett Holman <brett.holman@canonical.com>
|
||||||
Date: Wed, 3 Jan 2024 09:11:40 -0700
|
Date: Wed, 3 Jan 2024 09:11:40 -0700
|
||||||
Subject: [PATCH] fix(cloudstack): Use parsed lease file for virtual router in
|
Subject: [PATCH] fix(cloudstack): Use parsed lease file for virtual router in
|
||||||
cloudstack
|
cloudstack
|
||||||
|
|
||||||
RH-Author: Ani Sinha <anisinha@redhat.com>
|
RH-Author: Ani Sinha <anisinha@redhat.com>
|
||||||
RH-MergeRequest: 137: fix(cloudstack): Use parsed lease file for virtual router in cloudstack
|
RH-MergeRequest: 85: fix(cloudstack): Use parsed lease file for virtual router in cloudstack
|
||||||
RH-Jira: RHEL-40418
|
RH-Jira: RHEL-40217
|
||||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||||
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
RH-Commit: [1/1] 77f97c04432fffff125dc1725d66b33ae0ab4af8
|
RH-Commit: [1/1] 9d1353620ee2c773170e424479bb2664116554f4 (anisinha/cloud-init)
|
||||||
|
|
||||||
Fixes 5942f4023e2581a
|
Fixes 5942f4023e2581a
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user