summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-01-12 13:21:04 +0100
committerScott Moser <smoser@ubuntu.com>2012-01-12 13:21:04 +0100
commitad3a229c82409936f5f01b3a03507cd5ed3031d9 (patch)
treec2fb6ca18bd33887bbb3fbf458cff0b09cb8a009
parent40267132dff97d9912670dcf49c065d0e9def437 (diff)
downloadvyos-cloud-init-ad3a229c82409936f5f01b3a03507cd5ed3031d9.tar.gz
vyos-cloud-init-ad3a229c82409936f5f01b3a03507cd5ed3031d9.zip
fix selection of ec2 mirrors when inside ec2.
LP: #915282
-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]