diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-07-22 13:06:34 +0100 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-07-22 13:06:34 +0100 |
commit | bc7d57a0ae827978c87919c833bb5e8d2d5143c6 (patch) | |
tree | 4a3e97d4f0760f00682b9e84888c4b3f001c3777 /cloudinit/distros | |
parent | 73c5bbfa31b922a0ba403216c0fc1f63b22a9262 (diff) | |
download | vyos-cloud-init-bc7d57a0ae827978c87919c833bb5e8d2d5143c6.tar.gz vyos-cloud-init-bc7d57a0ae827978c87919c833bb5e8d2d5143c6.zip |
Add DataSource.region and use it in mirror selection.
Also implement DataSource.region for EC2 and GCE data sources.
Diffstat (limited to 'cloudinit/distros')
-rw-r--r-- | cloudinit/distros/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 47b76c68..71884b32 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -577,6 +577,9 @@ def _get_package_mirror_info(mirror_info, data_source=None, if re.match(ec2_az_re, data_source.availability_zone): subst['ec2_region'] = "%s" % data_source.availability_zone[0:-1] + if data_source and data_source.region: + subst['region'] = data_source.region + results = {} for (name, mirror) in mirror_info.get('failsafe', {}).items(): results[name] = mirror |