From d72e42c9578459f8cf41a0853028206b4e9c7e3a Mon Sep 17 00:00:00 2001 From: eb3095 <45504889+eb3095@users.noreply.github.com> Date: Wed, 2 Feb 2022 17:26:37 -0500 Subject: vultr: Return metadata immediately when found (#1233) --- cloudinit/sources/helpers/vultr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/sources') diff --git a/cloudinit/sources/helpers/vultr.py b/cloudinit/sources/helpers/vultr.py index 350ba4ab..190a5640 100644 --- a/cloudinit/sources/helpers/vultr.py +++ b/cloudinit/sources/helpers/vultr.py @@ -35,11 +35,11 @@ def get_metadata(url, timeout, retries, sec_between, agent): # Fetch the metadata v1 = read_metadata(url, timeout, retries, sec_between, agent) + + return json.loads(v1) except (NoDHCPLeaseError, subp.ProcessExecutionError) as exc: LOG.error("DHCP Exception: %s", exc) exception = exc - - return json.loads(v1) raise exception -- cgit v1.2.3