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
c3caff5e
Commit
c3caff5e
authored
Jun 03, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for six version 1.1.0 (rhel6).
parent
6b642afc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
lib/ansible/parsing/vault/__init__.py
+11
-11
No files found.
lib/ansible/parsing/vault/__init__.py
View file @
c3caff5e
...
...
@@ -36,18 +36,18 @@ from hashlib import sha256
from
hashlib
import
md5
from
binascii
import
hexlify
from
binascii
import
unhexlify
from
six
import
binary_type
,
PY
2
,
text_type
from
six
import
binary_type
,
PY
3
,
text_type
try
:
from
six
import
byte2int
except
ImportError
:
# bytes2int added in six-1.4.0
if
PY2
:
def
byte2int
(
bs
):
return
ord
(
bs
[
0
])
else
:
if
PY3
:
import
operator
byte2int
=
operator
.
itemgetter
(
0
)
else
:
def
byte2int
(
bs
):
return
ord
(
bs
[
0
])
from
ansible
import
constants
as
C
from
ansible.utils.unicode
import
to_unicode
,
to_bytes
...
...
@@ -463,10 +463,10 @@ class VaultAES(object):
while
not
finished
:
chunk
,
next_chunk
=
next_chunk
,
cipher
.
decrypt
(
in_file
.
read
(
1024
*
bs
))
if
len
(
next_chunk
)
==
0
:
if
PY2
:
padding_length
=
ord
(
chunk
[
-
1
])
else
:
if
PY3
:
padding_length
=
chunk
[
-
1
]
else
:
padding_length
=
ord
(
chunk
[
-
1
])
chunk
=
chunk
[:
-
padding_length
]
finished
=
True
...
...
@@ -608,8 +608,8 @@ class VaultAES256(object):
result
=
0
for
x
,
y
in
zip
(
a
,
b
):
if
PY2
:
result
|=
ord
(
x
)
^
ord
(
y
)
else
:
if
PY3
:
result
|=
x
^
y
else
:
result
|=
ord
(
x
)
^
ord
(
y
)
return
result
==
0
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