|
|
0d90ce |
diff -uNr a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py
|
|
|
0d90ce |
--- a/fence/agents/compute/fence_compute.py 2017-04-03 13:46:57.686399749 +0200
|
|
|
0d90ce |
+++ b/fence/agents/compute/fence_compute.py 2017-04-03 14:26:37.882659207 +0200
|
|
|
0d90ce |
@@ -314,45 +314,45 @@
|
|
|
0d90ce |
|
|
|
0d90ce |
versions = [ "2.11", "2" ]
|
|
|
0d90ce |
for version in versions:
|
|
|
0d90ce |
- clientargs = inspect.getargspec(client.Client).varargs
|
|
|
0d90ce |
+ clientargs = inspect.getargspec(client.Client).varargs
|
|
|
0d90ce |
|
|
|
0d90ce |
- # Some versions of Openstack prior to Ocata only
|
|
|
0d90ce |
- # supported positional arguments for username,
|
|
|
0d90ce |
- # password and tenant.
|
|
|
0d90ce |
- #
|
|
|
0d90ce |
- # Versions since Ocata only support named arguments.
|
|
|
0d90ce |
- #
|
|
|
0d90ce |
- # So we need to use introspection to figure out how to
|
|
|
0d90ce |
- # create a Nova client.
|
|
|
0d90ce |
- #
|
|
|
0d90ce |
- # Happy days
|
|
|
0d90ce |
- #
|
|
|
0d90ce |
- if clientargs:
|
|
|
0d90ce |
- # OSP < 11
|
|
|
0d90ce |
- # ArgSpec(args=['version', 'username', 'password', 'project_id', 'auth_url'],
|
|
|
0d90ce |
- # varargs=None,
|
|
|
0d90ce |
- # keywords='kwargs', defaults=(None, None, None, None))
|
|
|
0d90ce |
- nova = client.Client(version,
|
|
|
0d90ce |
- options["--username"],
|
|
|
0d90ce |
- options["--password"],
|
|
|
0d90ce |
- options["--tenant-name"],
|
|
|
0d90ce |
- options["--auth-url"],
|
|
|
0d90ce |
- insecure=options["--insecure"],
|
|
|
0d90ce |
- region_name=options["--region-name"],
|
|
|
0d90ce |
- endpoint_type=options["--endpoint-type"],
|
|
|
0d90ce |
- http_log_debug=options.has_key("--verbose"))
|
|
|
0d90ce |
- else:
|
|
|
0d90ce |
- # OSP >= 11
|
|
|
0d90ce |
- # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None)
|
|
|
0d90ce |
- nova = client.Client(version,
|
|
|
0d90ce |
- username=options["--username"],
|
|
|
0d90ce |
- password=options["--password"],
|
|
|
0d90ce |
- tenant_name=options["--tenant-name"],
|
|
|
0d90ce |
- auth_url=options["--auth-url"],
|
|
|
0d90ce |
- insecure=options["--insecure"],
|
|
|
0d90ce |
- region_name=options["--region-name"],
|
|
|
0d90ce |
- endpoint_type=options["--endpoint-type"],
|
|
|
0d90ce |
- http_log_debug=options.has_key("--verbose"))
|
|
|
0d90ce |
+ # Some versions of Openstack prior to Ocata only
|
|
|
0d90ce |
+ # supported positional arguments for username,
|
|
|
0d90ce |
+ # password and tenant.
|
|
|
0d90ce |
+ #
|
|
|
0d90ce |
+ # Versions since Ocata only support named arguments.
|
|
|
0d90ce |
+ #
|
|
|
0d90ce |
+ # So we need to use introspection to figure out how to
|
|
|
0d90ce |
+ # create a Nova client.
|
|
|
0d90ce |
+ #
|
|
|
0d90ce |
+ # Happy days
|
|
|
0d90ce |
+ #
|
|
|
0d90ce |
+ if clientargs:
|
|
|
0d90ce |
+ # OSP < 11
|
|
|
0d90ce |
+ # ArgSpec(args=['version', 'username', 'password', 'project_id', 'auth_url'],
|
|
|
0d90ce |
+ # varargs=None,
|
|
|
0d90ce |
+ # keywords='kwargs', defaults=(None, None, None, None))
|
|
|
0d90ce |
+ nova = client.Client(version,
|
|
|
0d90ce |
+ options["--username"],
|
|
|
0d90ce |
+ options["--password"],
|
|
|
0d90ce |
+ options["--tenant-name"],
|
|
|
0d90ce |
+ options["--auth-url"],
|
|
|
0d90ce |
+ insecure=options["--insecure"],
|
|
|
0d90ce |
+ region_name=options["--region-name"],
|
|
|
0d90ce |
+ endpoint_type=options["--endpoint-type"],
|
|
|
0d90ce |
+ http_log_debug=options.has_key("--verbose"))
|
|
|
0d90ce |
+ else:
|
|
|
0d90ce |
+ # OSP >= 11
|
|
|
0d90ce |
+ # ArgSpec(args=['version'], varargs='args', keywords='kwargs', defaults=None)
|
|
|
0d90ce |
+ nova = client.Client(version,
|
|
|
0d90ce |
+ username=options["--username"],
|
|
|
0d90ce |
+ password=options["--password"],
|
|
|
0d90ce |
+ tenant_name=options["--tenant-name"],
|
|
|
0d90ce |
+ auth_url=options["--auth-url"],
|
|
|
0d90ce |
+ insecure=options["--insecure"],
|
|
|
0d90ce |
+ region_name=options["--region-name"],
|
|
|
0d90ce |
+ endpoint_type=options["--endpoint-type"],
|
|
|
0d90ce |
+ http_log_debug=options.has_key("--verbose"))
|
|
|
0d90ce |
|
|
|
0d90ce |
try:
|
|
|
0d90ce |
nova.hypervisors.list()
|