diff --git a/extraconfig/tasks/instanceha/check-run-nova-compute b/extraconfig/tasks/instanceha/check-run-nova-compute index 7c75aae851..dd8342a337 100755 --- a/extraconfig/tasks/instanceha/check-run-nova-compute +++ b/extraconfig/tasks/instanceha/check-run-nova-compute @@ -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)