Merge "Fix Swift Authentication for log commands"
This commit is contained in:
@@ -70,11 +70,14 @@ class Instances(base.ManagerWithFind):
|
|||||||
user = self.api.client.auth._username
|
user = self.api.client.auth._username
|
||||||
key = self.api.client.auth._password
|
key = self.api.client.auth._password
|
||||||
tenant_name = self.api.client.auth._project_name
|
tenant_name = self.api.client.auth._project_name
|
||||||
|
auth_version = "3.0"
|
||||||
else:
|
else:
|
||||||
auth_url = self.api.client.auth_url
|
auth_url = self.api.client.auth_url
|
||||||
user = self.api.client.username
|
user = self.api.client.username
|
||||||
key = self.api.client.password
|
key = self.api.client.password
|
||||||
tenant_name = self.api.client.tenant
|
tenant_name = self.api.client.tenant
|
||||||
|
auth_version = "2.0"
|
||||||
|
|
||||||
# remove '/tokens' from the end of auth_url so it works for swift
|
# remove '/tokens' from the end of auth_url so it works for swift
|
||||||
token_str = "/tokens"
|
token_str = "/tokens"
|
||||||
if auth_url.endswith(token_str):
|
if auth_url.endswith(token_str):
|
||||||
@@ -83,7 +86,8 @@ class Instances(base.ManagerWithFind):
|
|||||||
os_options = {'tenant_name': tenant_name, 'region_name': region_name}
|
os_options = {'tenant_name': tenant_name, 'region_name': region_name}
|
||||||
|
|
||||||
return swift_client.Connection(
|
return swift_client.Connection(
|
||||||
auth_url, user, key, auth_version="2.0", os_options=os_options)
|
auth_url, user, key, auth_version=auth_version,
|
||||||
|
os_options=os_options)
|
||||||
|
|
||||||
def create(self, name, flavor_id, volume=None, databases=None, users=None,
|
def create(self, name, flavor_id, volume=None, databases=None, users=None,
|
||||||
restorePoint=None, availability_zone=None, datastore=None,
|
restorePoint=None, availability_zone=None, datastore=None,
|
||||||
|
Reference in New Issue
Block a user