From b9cde9cc426282906bbcd13463e89f518b6daeee Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 17 Jan 2014 16:11:44 -0500 Subject: [PATCH] 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 --- awx/main/tasks.py | 3 ++- awx/settings/defaults.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index b0ffbd586d..f92a2c3070 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -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') diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index b1d55bee11..1498d9ef27 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -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