Allow method verb override in get_temp_url

This will allow TempURLs to be used for GET too.

Change-Id: I0eb896d1a5a9a6b54aaa95e7942cc0d48108ea63
Partial-Blueprint: swift-deployment-transport
This commit is contained in:
Steve Baker 2014-08-21 09:09:33 +12:00
parent 848bc37e2a
commit bb20eb821b
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,8 @@ class SwiftClientPlugin(client_plugin.ClientPlugin):
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.
'''
@ -93,7 +94,6 @@ class SwiftClientPlugin(client_plugin.ClientPlugin):
key = hashlib.sha224(str(random.getrandbits(256))).hexdigest()[:32]
self.client().post_account({key_header: key})
method = 'PUT'
path = '/v1/AUTH_%s/%s/%s' % (self.context.tenant_id, container_name,
obj_name)
if timeout is None: