Fixes #6187 Add unit tests for VaultLib

This commit is contained in:
James Tanner 2014-02-26 12:10:04 -05:00
commit baed7a0ed9
2 changed files with 78 additions and 0 deletions

View file

@ -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()