mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Fix up all python3 issues that do not have to do with text/bytes
This commit is contained in:
parent
050d17295d
commit
67ff4428d5
5 changed files with 15 additions and 12 deletions
|
@ -125,7 +125,7 @@ class TestVaultLib(unittest.TestCase):
|
|||
error_hit = False
|
||||
try:
|
||||
enc_data = v.encrypt(data)
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
assert error_hit, "No error was thrown when trying to encrypt data with a header"
|
||||
|
||||
|
@ -137,7 +137,7 @@ class TestVaultLib(unittest.TestCase):
|
|||
error_hit = False
|
||||
try:
|
||||
dec_data = v.decrypt(data)
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
assert error_hit, "No error was thrown when trying to decrypt data without a header"
|
||||
|
||||
|
@ -150,7 +150,7 @@ class TestVaultLib(unittest.TestCase):
|
|||
error_hit = False
|
||||
try:
|
||||
enc_data = v.encrypt(data)
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
assert not error_hit, "An error was thrown when trying to encrypt data without the cipher set"
|
||||
assert v.cipher_name == "AES256", "cipher name is not set to AES256: %s" % v.cipher_name
|
||||
|
|
|
@ -97,9 +97,9 @@ class TestVaultEditor(unittest.TestCase):
|
|||
|
||||
# make sure the password functions for the cipher
|
||||
error_hit = False
|
||||
try:
|
||||
try:
|
||||
ve.decrypt_file()
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
|
||||
# verify decrypted content
|
||||
|
@ -125,9 +125,9 @@ class TestVaultEditor(unittest.TestCase):
|
|||
|
||||
# make sure the password functions for the cipher
|
||||
error_hit = False
|
||||
try:
|
||||
try:
|
||||
ve.decrypt_file()
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
|
||||
# verify decrypted content
|
||||
|
@ -155,7 +155,7 @@ class TestVaultEditor(unittest.TestCase):
|
|||
error_hit = False
|
||||
try:
|
||||
ve.rekey_file('ansible2')
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
|
||||
# verify decrypted content
|
||||
|
@ -171,7 +171,7 @@ class TestVaultEditor(unittest.TestCase):
|
|||
error_hit = False
|
||||
try:
|
||||
dec_data = vl.decrypt(fdata)
|
||||
except errors.AnsibleError, e:
|
||||
except errors.AnsibleError as e:
|
||||
error_hit = True
|
||||
|
||||
os.unlink(v10_file.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue