summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-03-23 15:39:51 -0400
committerGitHub <noreply@github.com>2020-03-23 13:39:51 -0600
commita18338e99d0ab91f1f08b969bce8181938a284cc (patch)
treebe6fa5446bce267654ee2c2f07bf13e03b640a82 /cloudinit/util.py
parentdf7a7857566c98df03cd7914643433b15faab5bc (diff)
downloadvyos-cloud-init-a18338e99d0ab91f1f08b969bce8181938a284cc.tar.gz
vyos-cloud-init-a18338e99d0ab91f1f08b969bce8181938a284cc.zip
cc_apt_configure/util: combine search_for_mirror implementations (#271)
These two implementations had drifted away from one another very slightly. Reconcile them and then remove the one in cc_apt_configure.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 6a641550..9cc87d7d 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1230,9 +1230,14 @@ def search_for_mirror(candidates):
Search through a list of mirror urls for one that works
This needs to return quickly.
"""
+ if candidates is None:
+ return None
+
+ LOG.debug("search for mirror in candidates: '%s'", candidates)
for cand in candidates:
try:
if is_resolvable_url(cand):
+ LOG.debug("found working mirror: '%s'", cand)
return cand
except Exception:
pass