~oddbloke/cloud-init/fix-gce-az

« back to all changes in this revision

Viewing changes to cloudinit/distros/__init__.py

  • Committer: Daniel Watkins
  • Date: 2015-07-22 12:06:34 UTC
  • Revision ID: daniel.watkins@canonical.com-20150722120634-90bdpdli7eora2j7
Add DataSource.region and use it in mirror selection.

Also implement DataSource.region for EC2 and GCE data sources.

Show diffs side-by-side

added added

removed removed

Lines of Context:
577
577
        if re.match(ec2_az_re, data_source.availability_zone):
578
578
            subst['ec2_region'] = "%s" % data_source.availability_zone[0:-1]
579
579
 
 
580
    if data_source and data_source.region:
 
581
        subst['region'] = data_source.region
 
582
 
580
583
    results = {}
581
584
    for (name, mirror) in mirror_info.get('failsafe', {}).items():
582
585
        results[name] = mirror