mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Fixes #6187 Add unit tests for VaultLib
This commit is contained in:
parent
33857855ad
commit
baed7a0ed9
2 changed files with 78 additions and 0 deletions
|
@ -58,6 +58,9 @@ class VaultLib(object):
|
|||
if self.is_encrypted(data):
|
||||
raise errors.AnsibleError("data is already encrypted")
|
||||
|
||||
if not self.cipher_name:
|
||||
raise errors.AnsibleError("the cipher must be set before encrypting data")
|
||||
|
||||
if 'Vault' + self.cipher_name in globals() and self.cipher_name in CIPHER_WHITELIST:
|
||||
cipher = globals()['Vault' + self.cipher_name]
|
||||
this_cipher = cipher()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue