diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-05-19 08:21:34 -0700 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-05-19 08:21:34 -0700 |
commit | 151ece4efcd6d8f5051e86dff2bcd7d218e50ca2 (patch) | |
tree | d1fd6ed628e4d1576443110692b3f3494af51c31 | |
parent | eb2fe760f2b714f3d7a7a95cb9515d7691da9511 (diff) | |
download | vyos-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-- | ChangeLog | 1 | ||||
-rw-r--r-- | cloudinit/distros/__init__.py | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -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: |