Fix RS swift client to match correct signature
Also, fix tenant id lookup for token format Change-Id: I46393e8273cfb68a902f2f1aef6829fcce4afca2
This commit is contained in:
parent
45be90bb22
commit
de1b47cede
@ -197,12 +197,14 @@ class RackspaceSwiftClient(swift.SwiftClientPlugin):
|
|||||||
parts[3] and
|
parts[3] and
|
||||||
parts[4].strip('/'))
|
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.
|
Return a Swift TempURL.
|
||||||
'''
|
'''
|
||||||
def tenant_uuid():
|
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':
|
if role['name'] == 'object-store:default':
|
||||||
return role['tenantId']
|
return role['tenantId']
|
||||||
|
|
||||||
@ -213,7 +215,6 @@ class RackspaceSwiftClient(swift.SwiftClientPlugin):
|
|||||||
key = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[:32]
|
key = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[:32]
|
||||||
self.client().post_account({key_header: key})
|
self.client().post_account({key_header: key})
|
||||||
|
|
||||||
method = 'PUT'
|
|
||||||
path = '/v1/%s/%s/%s' % (tenant_uuid(), container_name, obj_name)
|
path = '/v1/%s/%s/%s' % (tenant_uuid(), container_name, obj_name)
|
||||||
if timeout is None:
|
if timeout is None:
|
||||||
timeout = swift.MAX_EPOCH - 60 - time.time()
|
timeout = swift.MAX_EPOCH - 60 - time.time()
|
||||||
|
Loading…
Reference in New Issue
Block a user