Fix RS swift client to match correct signature

Also, fix tenant id lookup for token format

Change-Id: I46393e8273cfb68a902f2f1aef6829fcce4afca2
This commit is contained in:
Randall Burt 2015-03-12 18:20:15 -05:00
parent 45be90bb22
commit de1b47cede

View File

@ -197,12 +197,14 @@ class RackspaceSwiftClient(swift.SwiftClientPlugin):
parts[3] and
parts[4].strip('/'))
def get_temp_url(self, container_name, obj_name, timeout=None):
def get_temp_url(self, container_name, obj_name, timeout=None,
method='PUT'):
'''
Return a Swift TempURL.
'''
def tenant_uuid():
for role in self.context.auth_token_info['user']['roles']:
access = self.context.auth_token_info['access']
for role in access['user']['roles']:
if role['name'] == 'object-store:default':
return role['tenantId']
@ -213,7 +215,6 @@ class RackspaceSwiftClient(swift.SwiftClientPlugin):
key = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[:32]
self.client().post_account({key_header: key})
method = 'PUT'
path = '/v1/%s/%s/%s' % (tenant_uuid(), container_name, obj_name)
if timeout is None:
timeout = swift.MAX_EPOCH - 60 - time.time()