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
4bbca921
Commit
4bbca921
authored
Apr 13, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10687 from ianzd/devel
Several more changes to support python3 syntax.
parents
483c8d33
1bdf0bb0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
v2/ansible/plugins/action/__init__.py
+1
-1
v2/ansible/plugins/lookup/password.py
+4
-4
No files found.
v2/ansible/plugins/action/__init__.py
View file @
4bbca921
...
...
@@ -19,7 +19,7 @@
from
__future__
import
(
absolute_import
,
division
,
print_function
)
__metaclass__
=
type
import
StringIO
from
six.moves
import
StringIO
import
json
import
os
import
random
...
...
v2/ansible/plugins/lookup/password.py
View file @
4bbca921
...
...
@@ -98,7 +98,7 @@ class LookupModule(LookupBase):
pathdir
=
os
.
path
.
dirname
(
path
)
if
not
os
.
path
.
isdir
(
pathdir
):
try
:
os
.
makedirs
(
pathdir
,
mode
=
0700
)
os
.
makedirs
(
pathdir
,
mode
=
0
o
700
)
except
OSError
as
e
:
raise
AnsibleError
(
"cannot create the path for the password lookup:
%
s (error was
%
s)"
%
(
pathdir
,
str
(
e
)))
...
...
@@ -111,7 +111,7 @@ class LookupModule(LookupBase):
else
:
content
=
password
with
open
(
path
,
'w'
)
as
f
:
os
.
chmod
(
path
,
0600
)
os
.
chmod
(
path
,
0
o
600
)
f
.
write
(
content
+
'
\n
'
)
else
:
content
=
open
(
path
)
.
read
()
.
rstrip
()
...
...
@@ -129,12 +129,12 @@ class LookupModule(LookupBase):
salt
=
self
.
random_salt
()
content
=
'
%
s salt=
%
s'
%
(
password
,
salt
)
with
open
(
path
,
'w'
)
as
f
:
os
.
chmod
(
path
,
0600
)
os
.
chmod
(
path
,
0
o
600
)
f
.
write
(
content
+
'
\n
'
)
# crypt not requested, remove salt if present
elif
(
encrypt
is
None
and
salt
):
with
open
(
path
,
'w'
)
as
f
:
os
.
chmod
(
path
,
0600
)
os
.
chmod
(
path
,
0
o
600
)
f
.
write
(
password
+
'
\n
'
)
if
encrypt
:
...
...
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