mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Treat files as binary when downloading attachments
This commit is contained in:
@@ -289,8 +289,8 @@ class TSSClient(object):
|
|||||||
if file_download_path and os.path.isdir(file_download_path):
|
if file_download_path and os.path.isdir(file_download_path):
|
||||||
if i['isFile']:
|
if i['isFile']:
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(file_download_path, str(obj['id']) + "_" + i['slug']), "w") as f:
|
with open(os.path.join(file_download_path, str(obj['id']) + "_" + i['slug']), "wb") as f:
|
||||||
f.write(i['itemValue'].text)
|
f.write(i['itemValue'].content)
|
||||||
i['itemValue'] = "*** Not Valid For Display ***"
|
i['itemValue'] = "*** Not Valid For Display ***"
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise AnsibleOptionsError("Failed to download {0}".format(str(i['slug'])))
|
raise AnsibleOptionsError("Failed to download {0}".format(str(i['slug'])))
|
||||||
|
|||||||
Reference in New Issue
Block a user