SHA256
1
0
forked from pool/cloud-init

Compare commits

...

6 Commits

3 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,36 @@
--- cloudinit/sources/helpers/openstack.py.orig
+++ cloudinit/sources/helpers/openstack.py
@@ -736,7 +736,14 @@ def convert_net_json(network_json=None,
if not mac:
raise ValueError("No mac_address or name entry for %s" % d)
if mac not in known_macs:
- raise ValueError("Unable to find a system nic for %s" % d)
+ # Let's give udev a chance to catch up
+ try:
+ util.udevadm_settle()
+ except subp.ProcessExecutionError:
+ pass
+ known_macs = net.get_interfaces_by_mac()
+ if mac not in known_macs:
+ raise ValueError("Unable to find a system nic for %s" % d)
d["name"] = known_macs[mac]
for cfg, key, fmt, targets in link_updates:
--- tests/unittests/sources/test_configdrive.py.orig
+++ tests/unittests/sources/test_configdrive.py
@@ -389,6 +389,7 @@ class TestConfigDriveDataSource(CiTestCa
M_PATH + "util.find_devs_with", "m_find_devs_with", return_value=[]
)
self.tmp = self.tmp_dir()
+ self.allowed_subp = True
def test_ec2_metadata(self):
populate_dir(self.tmp, CFG_DRIVE_FILES_V2)
@@ -869,6 +870,7 @@ class TestConvertNetworkData(CiTestCase)
def setUp(self):
super(TestConvertNetworkData, self).setUp()
self.tmp = self.tmp_dir()
+ self.allowed_subp = True
def _getnames_in_config(self, ncfg):
return set(

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 6 13:17:05 UTC 2025 - Robert Schweikert <rjschwei@suse.com>
- Add cloud-init-wait-for-net.patch (bsc#1227237)
+ Wait for udev once if we cannot find the expected MAC
-------------------------------------------------------------------
Fri Jun 14 10:34:54 UTC 2024 - Markéta Machová <mmachova@suse.com>
@ -7,7 +13,7 @@ Fri Jun 14 10:34:54 UTC 2024 - Markéta Machová <mmachova@suse.com>
Mon Jun 3 19:53:46 UTC 2024 - Robert Schweikert <rjschwei@suse.com>
- Add cloud-init-skip-rename.patch (bsc#1219680)
+ Brute force appraoch to skip renames if the device is already present
+ Brute force approach to skip renames if the device is already present
-------------------------------------------------------------------
Mon Apr 29 21:49:48 UTC 2024 - Robert Schweikert <rjschwei@suse.com>

View File

@ -53,6 +53,8 @@ Patch13: cloud-init-no-nmcfg-needed.patch
Patch14: cloud-init-usr-sudoers.patch
# FIXME https://github.com/canonical/cloud-init/issues/5075
Patch15: cloud-init-skip-rename.patch
# FIXME https://github.com/canonical/cloud-init/pull/5947
Patch16: cloud-init-wait-for-net.patch
BuildRequires: fdupes
BuildRequires: filesystem
# pkg-config is needed to find correct systemd unit dir
@ -166,6 +168,7 @@ Documentation and examples for cloud-init tools
%patch -P 13
%patch -P 14
%patch -P 15
%patch -P 16
# patch in the full version to version.py
version_pys=$(find . -name version.py -type f)