|
@@ -108,14 +108,6 @@ def get_default_region():
|
|
|
return get_region(conf=AWS_ACCOUNTS['default']) if 'default' in AWS_ACCOUNTS else get_region()
|
|
return get_region(conf=AWS_ACCOUNTS['default']) if 'default' in AWS_ACCOUNTS else get_region()
|
|
|
|
|
|
|
|
|
|
|
|
|
-def get_default_host():
|
|
|
|
|
- '''Returns the S3 host when Raz is configured'''
|
|
|
|
|
-
|
|
|
|
|
- if get_raz_api_url():
|
|
|
|
|
- endpoint = get_raz_s3_default_bucket()
|
|
|
|
|
- if endpoint:
|
|
|
|
|
- return endpoint.get('host')
|
|
|
|
|
-
|
|
|
|
|
def get_region(conf=None):
|
|
def get_region(conf=None):
|
|
|
global REGION_CACHED
|
|
global REGION_CACHED
|
|
|
|
|
|
|
@@ -123,9 +115,9 @@ def get_region(conf=None):
|
|
|
return REGION_CACHED
|
|
return REGION_CACHED
|
|
|
region = ''
|
|
region = ''
|
|
|
|
|
|
|
|
- if conf or get_default_host():
|
|
|
|
|
|
|
+ if conf:
|
|
|
# First check the host/endpoint configuration
|
|
# First check the host/endpoint configuration
|
|
|
- endpoint = get_default_host() or conf.HOST.get()
|
|
|
|
|
|
|
+ endpoint = conf.HOST.get()
|
|
|
if endpoint:
|
|
if endpoint:
|
|
|
if re.search(SUBDOMAIN_ENDPOINT_RE, endpoint, re.IGNORECASE):
|
|
if re.search(SUBDOMAIN_ENDPOINT_RE, endpoint, re.IGNORECASE):
|
|
|
region = re.search(SUBDOMAIN_ENDPOINT_RE, endpoint, re.IGNORECASE).group('region')
|
|
region = re.search(SUBDOMAIN_ENDPOINT_RE, endpoint, re.IGNORECASE).group('region')
|