From 7420dbbe3d9527ad530310224e05734b3c80233a Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Tue, 20 Dec 2016 11:18:33 -0500 Subject: Fix Swift Authentication for log commands Updates the swift authentication handling in v1/instances:_get_swift_client to set auth_version as appropriate. Change-Id: I39a22eeb4a9c371f333f81a69d4d429805b935f9 Fixes-bug: 1651502 --- troveclient/v1/instances.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/troveclient/v1/instances.py b/troveclient/v1/instances.py index a25b192..661be6a 100644 --- a/troveclient/v1/instances.py +++ b/troveclient/v1/instances.py @@ -72,11 +72,14 @@ class Instances(base.ManagerWithFind): user = self.api.client.auth._username key = self.api.client.auth._password tenant_name = self.api.client.auth._project_name + auth_version = "3.0" else: auth_url = self.api.client.auth_url user = self.api.client.username key = self.api.client.password tenant_name = self.api.client.tenant + auth_version = "2.0" + # remove '/tokens' from the end of auth_url so it works for swift token_str = "/tokens" if auth_url.endswith(token_str): @@ -85,7 +88,8 @@ class Instances(base.ManagerWithFind): os_options = {'tenant_name': tenant_name, 'region_name': region_name} 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) # TODO(mriedem): Remove slave_of after liberty-eol for Trove. def create(self, name, flavor_id, volume=None, databases=None, users=None, -- cgit v1.2.1