Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
67ff4428
Commit
67ff4428
authored
Oct 28, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up all python3 issues that do not have to do with text/bytes
parent
050d1729
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
12 deletions
+15
-12
test/integration/Makefile
+3
-0
v2/ansible/parsing/vault/__init__.py
+2
-2
v2/ansible/parsing/yaml/__init__.py
+1
-1
v2/test/parsing/vault/test_vault.py
+3
-3
v2/test/parsing/vault/test_vault_editor.py
+6
-6
No files found.
test/integration/Makefile
View file @
67ff4428
...
...
@@ -38,6 +38,9 @@ unicode:
non_destructive
:
ansible-playbook non_destructive.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-v
$(TEST_FLAGS)
mine
:
ansible-playbook mine.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-v
$(TEST_FLAGS)
destructive
:
ansible-playbook destructive.yml
-i
$(INVENTORY)
-e
@
$(VARS_FILE)
$(CREDENTIALS_ARG)
-v
$(TEST_FLAGS)
...
...
v2/ansible/parsing/vault/__init__.py
View file @
67ff4428
...
...
@@ -507,7 +507,7 @@ class VaultAES256(object):
# 1) nbits (integer) - Length of the counter, in bits.
# 2) initial_value (integer) - initial value of the counter. "iv" from gen_key_initctr
ctr
=
Counter
.
new
(
128
,
initial_value
=
long
(
iv
,
16
))
ctr
=
Counter
.
new
(
128
,
initial_value
=
int
(
iv
,
16
))
# AES.new PARAMETERS
# 1) AES key, must be either 16, 24, or 32 bytes long -- "key" from gen_key_initctr
...
...
@@ -542,7 +542,7 @@ class VaultAES256(object):
return
None
# SET THE COUNTER AND THE CIPHER
ctr
=
Counter
.
new
(
128
,
initial_value
=
long
(
iv
,
16
))
ctr
=
Counter
.
new
(
128
,
initial_value
=
int
(
iv
,
16
))
cipher
=
AES
.
new
(
key1
,
AES
.
MODE_CTR
,
counter
=
ctr
)
# DECRYPT PADDED DATA
...
...
v2/ansible/parsing/yaml/__init__.py
View file @
67ff4428
...
...
@@ -71,7 +71,7 @@ class DataLoader():
# if loading JSON failed for any reason, we go ahead
# and try to parse it as YAML instead
return
self
.
_safe_load
(
data
)
except
YAMLError
,
yaml_exc
:
except
YAMLError
as
yaml_exc
:
self
.
_handle_error
(
yaml_exc
,
file_name
,
show_content
)
def
load_from_file
(
self
,
file_name
):
...
...
v2/test/parsing/vault/test_vault.py
View file @
67ff4428
...
...
@@ -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
v2/test/parsing/vault/test_vault_editor.py
View file @
67ff4428
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment