handle missing udev process
OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=239
This commit is contained in:
parent
fb5493d9e8
commit
14e9c00f78
@ -1,12 +1,15 @@
|
|||||||
--- cloudinit/sources/helpers/openstack.py.orig
|
--- cloudinit/sources/helpers/openstack.py.orig
|
||||||
+++ cloudinit/sources/helpers/openstack.py
|
+++ cloudinit/sources/helpers/openstack.py
|
||||||
@@ -736,7 +736,11 @@ def convert_net_json(network_json=None,
|
@@ -736,7 +736,14 @@ def convert_net_json(network_json=None,
|
||||||
if not mac:
|
if not mac:
|
||||||
raise ValueError("No mac_address or name entry for %s" % d)
|
raise ValueError("No mac_address or name entry for %s" % d)
|
||||||
if mac not in known_macs:
|
if mac not in known_macs:
|
||||||
- raise ValueError("Unable to find a system nic for %s" % d)
|
- raise ValueError("Unable to find a system nic for %s" % d)
|
||||||
+ # Let's give udev a chance to catch up
|
+ # Let's give udev a chance to catch up
|
||||||
|
+ try:
|
||||||
+ util.udevadm_settle()
|
+ util.udevadm_settle()
|
||||||
|
+ exceptsubp.ProcessExecutionError:
|
||||||
|
+ pass
|
||||||
+ known_macs = net.get_interfaces_by_mac()
|
+ known_macs = net.get_interfaces_by_mac()
|
||||||
+ if mac not in known_macs:
|
+ if mac not in known_macs:
|
||||||
+ raise ValueError("Unable to find a system nic for %s" % d)
|
+ raise ValueError("Unable to find a system nic for %s" % d)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user