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
8b38b19b
Commit
8b38b19b
authored
May 31, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Get rid of mktemp dependency to support AIX"
This reverts commit
4ad1b57b
.
parent
08112eca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
lib/ansible/runner/__init__.py
+12
-10
No files found.
lib/ansible/runner/__init__.py
View file @
8b38b19b
...
...
@@ -639,7 +639,7 @@ class Runner(object):
cache
=
self
.
setup_cache
.
get
(
host
,
{})
module_name
=
utils
.
template
(
self
.
module_name
,
cache
,
self
.
setup_cache
)
tmp
=
self
.
_
make
_tmp_path
(
conn
)
tmp
=
self
.
_
get
_tmp_path
(
conn
)
result
=
None
if
self
.
module_name
==
'copy'
:
...
...
@@ -691,20 +691,22 @@ class Runner(object):
# *****************************************************
def
_
make
_tmp_path
(
self
,
conn
):
'''
make and return
a temporary path on a remote box '''
def
_
get
_tmp_path
(
self
,
conn
):
'''
gets
a temporary path on a remote box '''
basetmp
=
C
.
DEFAULT_REMOTE_TMP
if
self
.
remote_user
==
'root'
:
basetmp
=
"/var/tmp"
basetmp
=
os
.
path
.
join
(
basetmp
,
'ansible-
%
s-
%
s'
%
(
time
.
time
(),
random
.
randint
(
0
,
2
**
48
)))
cmd
=
"mkdir -p
%
s"
%
basetmp
basetmp
=
"/var/tmp"
cmd
=
"mktemp -d
%
s/ansible.XXXXXX"
%
basetmp
if
self
.
remote_user
!=
'root'
:
cmd
+=
" && chmod a+x
%
s"
%
basetmp
cmd
=
"mkdir -p
%
s &&
%
s"
%
(
basetmp
,
cmd
)
result
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
return
basetmp
cleaned
=
result
.
split
(
"
\n
"
)[
0
]
.
strip
()
+
'/'
if
self
.
remote_user
!=
'root'
:
cmd
=
'chmod a+x
%
s'
%
cleaned
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
return
cleaned
# *****************************************************
...
...
@@ -718,7 +720,7 @@ class Runner(object):
if
not
os
.
path
.
exists
(
in_path
):
raise
errors
.
AnsibleFileNotFound
(
"module not found:
%
s"
%
in_path
)
out_path
=
os
.
path
.
join
(
tmp
,
module
)
out_path
=
tmp
+
module
conn
.
put_file
(
in_path
,
out_path
)
return
out_path
...
...
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