From 612e39087aee3b1242765e7c4f463f54a6ebd723 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Fri, 17 Sep 2021 13:04:07 -0500 Subject: Add connectivity_url to Oracle's EphemeralDHCPv4 (#988) Add connectivity_url to Oracle's EphemeralDHCPv4 On bionic, when trying to bring up the EphemeralDHCPv4, it's possible that we already have a route defined, which will result in an error when trying to add the DHCP route. Use the connectivity_url to check if we can reach the metadata service, and if so, skip the EphemeralDHCPv4. The has_url_connectivity function has also been modified to take a dict of kwargs to send to readurl. LP: #1939603 --- cloudinit/sources/helpers/vultr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/sources/helpers/vultr.py') diff --git a/cloudinit/sources/helpers/vultr.py b/cloudinit/sources/helpers/vultr.py index c22cd0b1..2521ec2f 100644 --- a/cloudinit/sources/helpers/vultr.py +++ b/cloudinit/sources/helpers/vultr.py @@ -20,7 +20,7 @@ LOG = log.getLogger(__name__) def get_metadata(url, timeout, retries, sec_between): # Bring up interface try: - with EphemeralDHCPv4(connectivity_url=url): + with EphemeralDHCPv4(connectivity_url_data={"url": url}): # Fetch the metadata v1 = read_metadata(url, timeout, retries, sec_between) except (NoDHCPLeaseError) as exc: -- cgit v1.2.3