mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Set the 'itemValue' for files, even when they can't be read
This commit is contained in:
@@ -292,11 +292,12 @@ class TSSClient(object):
|
||||
file_content = i['itemValue'].content
|
||||
with open(os.path.join(file_download_path, str(obj['id']) + "_" + i['slug']), "wb") as f:
|
||||
f.write(file_content)
|
||||
i['itemValue'] = "*** Not Valid For Display ***"
|
||||
except ValueError:
|
||||
raise AnsibleOptionsError("Failed to download {0}".format(str(i['slug'])))
|
||||
except AttributeError:
|
||||
display.warning("Could not read file content for {0}".format(str(i['slug'])))
|
||||
finally:
|
||||
i['itemValue'] = "*** Not Valid For Display ***"
|
||||
else:
|
||||
raise AnsibleOptionsError("File download path does not exist")
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user