Fix swift push
Change-Id: I86c814330b32aa9f27868d5b815f969f5545171f
This commit is contained in:
parent
09258822b2
commit
a497d3a48f
@ -196,10 +196,14 @@ def push_file(job_log_dir, file_path, publish_config):
|
|||||||
def swift_push_file(job_log_dir, file_path, swift_config):
|
def swift_push_file(job_log_dir, file_path, swift_config):
|
||||||
""" Push a log file to a swift server. """
|
""" Push a log file to a swift server. """
|
||||||
with open(file_path, 'r') as fd:
|
with open(file_path, 'r') as fd:
|
||||||
name = job_log_dir + '_' + os.path.basename(file_path)
|
name = os.path.join(job_log_dir, os.path.basename(file_path))
|
||||||
con = swiftclient.client.Connection(swift_config['authurl'],
|
con = swiftclient.client.Connection(
|
||||||
swift_config['user'],
|
authurl=swift_config['authurl'],
|
||||||
swift_config['apikey'])
|
user=swift_config['user'],
|
||||||
|
key=swift_config['password'],
|
||||||
|
os_options={'region_name': swift_config['region']},
|
||||||
|
tenant_name=swift_config['tenant'],
|
||||||
|
auth_version=2.0)
|
||||||
obj = con.put_object(swift_config['container'], name, fd)
|
obj = con.put_object(swift_config['container'], name, fd)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user