summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/CloudConfig')
-rw-r--r--cloudinit/CloudConfig/cc_apt_update_upgrade.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
index a60512e1..0677ceb5 100644
--- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py
+++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
@@ -207,14 +207,15 @@ def find_apt_mirror(cloud, cfg):
if mydom:
doms.append(".%s" % mydom)
- doms.extend((".localdomain", "",))
+ if not mirror:
+ doms.extend((".localdomain", "",))
- mirror_list = []
- mirrorfmt = "http://%s-mirror%s/%s" % (distro, "%s", distro )
- for post in doms:
- mirror_list.append(mirrorfmt % post)
+ mirror_list = []
+ mirrorfmt = "http://%s-mirror%s/%s" % (distro, "%s", distro )
+ for post in doms:
+ mirror_list.append(mirrorfmt % post)
- mirror = util.search_for_mirror(mirror_list)
+ mirror = util.search_for_mirror(mirror_list)
if not mirror:
mirror = defaults[distro]