diff options
author | eb3095 <45504889+eb3095@users.noreply.github.com> | 2022-03-24 16:24:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 15:24:22 -0500 |
commit | 92d18862a9bafccb0ca196f6d17b2052ab813353 (patch) | |
tree | 76d24d360fc9a0c0134ba66da9390144c47e1ae2 /cloudinit/sources/helpers | |
parent | aa531df37e62b7cc95f34eba6c227e826eba1278 (diff) | |
download | cloud-init-git-92d18862a9bafccb0ca196f6d17b2052ab813353.tar.gz |
Vultr: Use find_candidate_nics, use ipv6 dns (#1344)
Diffstat (limited to 'cloudinit/sources/helpers')
-rw-r--r-- | cloudinit/sources/helpers/vultr.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/cloudinit/sources/helpers/vultr.py b/cloudinit/sources/helpers/vultr.py index 1a7008aa..c8fb8420 100644 --- a/cloudinit/sources/helpers/vultr.py +++ b/cloudinit/sources/helpers/vultr.py @@ -25,7 +25,7 @@ def get_metadata(url, timeout, retries, sec_between, agent): for iface in get_interface_list(): try: with EphemeralDHCPv4( - iface=iface[0], connectivity_url_data={"url": url} + iface=iface, connectivity_url_data={"url": url} ): # Check for the metadata route, skip if not there if not check_route(url): @@ -47,20 +47,15 @@ def get_metadata(url, timeout, retries, sec_between, agent): # Get interface list, sort, and clean -# Should be replaced with find_candidate_nics -# Dummy and lo will remain to need to be removed def get_interface_list(): ifaces = [] - for iface in net.get_interfaces(): - # Skip dummy, lo interfaces - if "dummy" in iface[0]: - continue - if "lo" == iface[0]: + for iface in net.find_candidate_nics(): + # Skip dummy + if "dummy" in iface: continue ifaces.append(iface) - # Sort alphabetically - return sorted(ifaces, key=lambda i: i[0]) + return ifaces # Check for /32 route that our dhcp servers inject @@ -155,7 +150,12 @@ def get_interface_name(mac): def generate_network_config(interfaces): network = { "version": 1, - "config": [{"type": "nameserver", "address": ["108.61.10.10"]}], + "config": [ + { + "type": "nameserver", + "address": ["108.61.10.10", "2001:19f0:300:1704::6"], + } + ], } # Prepare interface 0, public |