summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog1
-rw-r--r--cloudinit/distros/__init__.py8
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b4175b7..ff06e989 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
- Fix exception when running with no arguments on Python 3. [Daniel Watkins]
- Centos: detect/expect use of systemd on centos 7. [Brian Rak]
- Azure: remove dependency on walinux-agent [Daniel Watkins]
+ - EC2: know about eu-central-1 availability-zone (LP: #1456684)
0.7.6:
- open 0.7.6
- Enable vendordata on CloudSigma datasource (LP: #1303986)
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: