Merge "Fix IHA with the new region_name key"

This commit is contained in:
Zuul 2018-10-25 09:20:22 +00:00 committed by Gerrit Code Review
commit 71fed814e7

View File

@ -111,6 +111,12 @@ def create_nova_connection(options):
if nova_endpoint_type in ['internal', 'public', 'admin']:
nova_endpoint_type += 'URL'
if 'region_name' in options:
region = options['region_name'][0]
elif 'os_region_name' in options:
region = options['os_region_name'][0]
else: # We actually try to make a client call even with an empty region
region = None
nova_versions = [ "2.23", "2" ]
for version in nova_versions:
clientargs = inspect.getargspec(client.Client).varargs
@ -136,7 +142,7 @@ def create_nova_connection(options):
None, # Tenant
None, # Auth URL
insecure=options["insecure"],
region_name=options["os_region_name"][0],
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug=options.has_key("verbose"),
endpoint_type=nova_endpoint_type)
@ -144,7 +150,7 @@ def create_nova_connection(options):
# OSP >= Ocata
# ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None)
nova = client.Client(version,
region_name=options["os_region_name"][0],
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug=options.has_key("verbose"),
endpoint_type=nova_endpoint_type)