Compute HA: Remove workaround for Newton and older

This change removes workaround in check-run-nova-compute script which
was implemented for ancient versions.

Change-Id: I9250953a179ba9a81b0289bc5e1239c4e0e54784
changes/23/800923/3
Takashi Kajinami 1 year ago
parent 9baa416151
commit e04f4a6187
  1. 40
      scripts/check-run-nova-compute

@ -119,41 +119,11 @@ def create_nova_connection(options):
region = None
nova_versions = [ "2.23", "2" ]
for version in nova_versions:
clientargs = inspect.getargspec(client.Client).varargs
# Some versions of Openstack prior to Ocata only
# supported positional arguments for username,
# password, and tenant.
#
# Versions since Ocata only support named arguments.
#
# So we need to use introspection to figure out how to
# create a Nova client.
#
# Happy days
#
if clientargs:
# OSP < Ocata
# ArgSpec(args=['version', 'username', 'password', 'project_id', 'auth_url'],
# varargs=None,
# keywords='kwargs', defaults=(None, None, None, None))
nova = client.Client(version,
None, # User
None, # Password
None, # Tenant
None, # Auth URL
insecure=options["insecure"],
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug="verbose" in options,
endpoint_type=nova_endpoint_type)
else:
# OSP >= Ocata
# ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None)
nova = client.Client(version,
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug="verbose" in options,
endpoint_type=nova_endpoint_type)
nova = client.Client(version,
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug="verbose" in options,
endpoint_type=nova_endpoint_type)
try:
nova.hypervisors.list()

Loading…
Cancel
Save