mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
If decryption of a vaulted file failed, include the filename in the error. (#16329)
Fixes #16327
This commit is contained in:
parent
8ee851cd95
commit
1db02dfb71
2 changed files with 11 additions and 5 deletions
|
@ -169,7 +169,7 @@ class DataLoader():
|
|||
with open(b_file_name, 'rb') as f:
|
||||
data = f.read()
|
||||
if self._vault.is_encrypted(data):
|
||||
data = self._vault.decrypt(data)
|
||||
data = self._vault.decrypt(data, filename=b_file_name)
|
||||
show_content = False
|
||||
|
||||
data = to_unicode(data, errors='strict')
|
||||
|
@ -339,7 +339,7 @@ class DataLoader():
|
|||
if not self._vault_password:
|
||||
raise AnsibleParserError("A vault password must be specified to decrypt %s" % file_path)
|
||||
|
||||
data = self._vault.decrypt(data)
|
||||
data = self._vault.decrypt(data, filename=real_path)
|
||||
# Make a temp file
|
||||
real_path = self._create_content_tempfile(data)
|
||||
self._tempfiles.add(real_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue