Fix issue AC-935... make sure we exclude certain regions by default. cn-north-1 was added to our dependency 'boto' here: https://github.com/boto/boto/pull/1939/files but is inaccessible from outside of China

This commit is contained in:
Matthew Jones 2014-01-17 16:11:44 -05:00
parent a103528967
commit b9cde9cc42
2 changed files with 7 additions and 1 deletions

View File

@ -772,8 +772,9 @@ class RunInventoryUpdate(BaseTask):
ec2_opts = dict(inventory_source.source_vars_dict.items())
regions = inventory_source.source_regions or 'all'
regions = ','.join([x.strip() for x in regions.split(',')])
regions_blacklist = ','.join(settings.EC2_REGIONS_BLACKLIST)
ec2_opts['regions'] = regions
ec2_opts.setdefault('regions_exclude', 'us-gov-west-1')
ec2_opts.setdefault('regions_exclude', regions_blacklist)
ec2_opts.setdefault('destination_variable', 'public_dns_name')
ec2_opts.setdefault('vpc_destination_variable', 'ip_address')
ec2_opts.setdefault('route53', 'False')

View File

@ -325,6 +325,11 @@ EC2_REGION_NAMES = {
'us-gov-west-1': 'US West (GovCloud)',
}
EC2_REGIONS_BLACKLIST = [
'us-gov-west-1',
'cn-north-1',
]
# Internal API URL for use by inventory scripts and callback plugin.
if 'devserver' in INSTALLED_APPS:
INTERNAL_API_URL = 'http://127.0.0.1:%s' % DEVSERVER_DEFAULT_PORT