Robert Schweikert
882510dff4
+ Wait for udev once if we cannot find the expected MAC OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=237
26 lines
1.1 KiB
Diff
26 lines
1.1 KiB
Diff
--- cloudinit/sources/helpers/openstack.py.orig
|
|
+++ cloudinit/sources/helpers/openstack.py
|
|
@@ -736,7 +736,11 @@ 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
|
|
+ util.udevadm_settle()
|
|
+ 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)
|