summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-05-19 08:21:34 -0700
committerScott Moser <smoser@ubuntu.com>2015-05-19 08:21:34 -0700
commit151ece4efcd6d8f5051e86dff2bcd7d218e50ca2 (patch)
treed1fd6ed628e4d1576443110692b3f3494af51c31 /cloudinit/distros
parenteb2fe760f2b714f3d7a7a95cb9515d7691da9511 (diff)
downloadvyos-cloud-init-151ece4efcd6d8f5051e86dff2bcd7d218e50ca2.tar.gz
vyos-cloud-init-151ece4efcd6d8f5051e86dff2bcd7d218e50ca2.zip
EC2: be aware of eu-central-1 availability zone
eu-central-1 means that 'central' is a direction to update the regular expression to understand. LP: #1456684
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 05721922..e0cce670 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -556,8 +556,12 @@ def _get_package_mirror_info(mirror_info, availability_zone=None,
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")
+ # ec2 availability zones are named cc-direction-[0-9][a-d] (us-east-1b)
+ # the region is us-east-1. so region = az[0:-1]
+ directions_re = '|'.join([
+ 'central', 'east', 'north', 'northeast', 'northwest',
+ 'south', 'southeast', 'southwest', 'west'])
+ ec2_az_re = ("^[a-z][a-z]-(%s)-[1-9][0-9]*[a-z]$" % directions_re)
subst = {}
if availability_zone: