Skip to content

Commit

Permalink
Vultr: Fix lo being used for DHCP, try next on cmd fail (#1208)
Browse files Browse the repository at this point in the history
  • Loading branch information
eb3095 authored Jan 28, 2022
1 parent 1b09576 commit 6a4b6dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cloudinit/sources/helpers/vultr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand Down

0 comments on commit 6a4b6dc

Please sign in to comment.