summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authoreb3095 <45504889+eb3095@users.noreply.github.com>2022-01-28 14:43:35 -0500
committerGitHub <noreply@github.com>2022-01-28 13:43:35 -0600
commit6a4b6dc0de94a9e75bb44fa6c03288c7d4dded7e (patch)
tree5ff6f43000930210df5b4422add55981ae936663 /cloudinit/sources
parent1b095760b5b7b7d59da12878098de97e3cb9885c (diff)
downloadvyos-cloud-init-6a4b6dc0de94a9e75bb44fa6c03288c7d4dded7e.tar.gz
vyos-cloud-init-6a4b6dc0de94a9e75bb44fa6c03288c7d4dded7e.zip
Vultr: Fix lo being used for DHCP, try next on cmd fail (#1208)
Diffstat (limited to 'cloudinit/sources')
-rw-r--r--cloudinit/sources/helpers/vultr.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/sources/helpers/vultr.py b/cloudinit/sources/helpers/vultr.py
index 9848f8fd..350ba4ab 100644
--- a/cloudinit/sources/helpers/vultr.py
+++ b/cloudinit/sources/helpers/vultr.py
@@ -21,9 +21,11 @@ def get_metadata(url, timeout, retries, sec_between, agent):
# Seek iface with DHCP
for iface in net.get_interfaces():
- # Skip dummy interfaces
+ # Skip dummy, lo interfaces
if "dummy" in iface[0]:
continue
+ if "lo" == iface[0]:
+ continue
try:
with EphemeralDHCPv4(
iface=iface[0], connectivity_url_data={"url": url}
@@ -33,7 +35,7 @@ def get_metadata(url, timeout, retries, sec_between, agent):
# Fetch the metadata
v1 = read_metadata(url, timeout, retries, sec_between, agent)
- except (NoDHCPLeaseError) as exc:
+ except (NoDHCPLeaseError, subp.ProcessExecutionError) as exc:
LOG.error("DHCP Exception: %s", exc)
exception = exc