summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-09-28 15:38:48 -0400
committerScott Moser <smoser@ubuntu.com>2012-09-28 15:38:48 -0400
commit92cbc3ae78b560cd6e81f2894d743b72b744eee1 (patch)
tree9c51e3eb3cea77b7c9c855c773105a5f3ebd2451 /cloudinit/distros/__init__.py
parentdfa62e70bd9942fd3c82d77217d48615a78bbcfc (diff)
parent46be69003044a7d60d9566dbddd1b7fd93054c8f (diff)
downloadvyos-cloud-init-92cbc3ae78b560cd6e81f2894d743b72b744eee1.tar.gz
vyos-cloud-init-92cbc3ae78b560cd6e81f2894d743b72b744eee1.zip
rpm spec and rpm build, better handle case with no package_mirrors
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 f07ba3fa..86ab557c 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -82,7 +82,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)
@@ -92,7 +92,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)
@@ -353,6 +352,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")