summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-09-28 14:21:02 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-09-28 14:21:02 -0700
commit72fc1f762e5c5df563380e9ed90bfaba131e811b (patch)
tree2420fd4938324bedc739ec4e1573a4211a12a02f /cloudinit/distros/__init__.py
parent5233b6edb70702476463b47c06cb02b3c7f74c51 (diff)
parentd285a0463b6d16487eb5859373ccfd27eaec8b90 (diff)
downloadvyos-cloud-init-72fc1f762e5c5df563380e9ed90bfaba131e811b.tar.gz
vyos-cloud-init-72fc1f762e5c5df563380e9ed90bfaba131e811b.zip
Sync with head and fix conflicts.
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r--cloudinit/distros/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 6b458d06..21efe8d9 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -83,7 +83,7 @@ class Distro(object):
return arch
def _get_arch_package_mirror_info(self, arch=None):
- mirror_info = self.get_option("package_mirrors", None)
+ mirror_info = self.get_option("package_mirrors", [])
if arch == None:
arch = self.get_primary_arch()
return _get_arch_package_mirror_info(mirror_info, arch)
@@ -93,7 +93,6 @@ class Distro(object):
# this resolves the package_mirrors config option
# down to a single dict of {mirror_name: mirror_url}
arch_info = self._get_arch_package_mirror_info(arch)
-
return _get_package_mirror_info(availability_zone=availability_zone,
mirror_info=arch_info)
@@ -356,6 +355,8 @@ def _get_package_mirror_info(mirror_info, availability_zone=None,
# given a arch specific 'mirror_info' entry (from package_mirrors)
# search through the 'search' entries, and fallback appropriately
# return a dict with only {name: mirror} entries.
+ if not mirror_info:
+ mirror_info = {}
ec2_az_re = ("^[a-z][a-z]-(%s)-[1-9][0-9]*[a-z]$" %
"north|northeast|east|southeast|south|southwest|west|northwest")