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
634cf9aa
Commit
634cf9aa
authored
May 31, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #437 from dagwieers/mktemp-vanish
Get rid of mktemp dependency to support AIX
parents
5c44ec44
a8fd6ee9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
lib/ansible/runner/__init__.py
+10
-12
No files found.
lib/ansible/runner/__init__.py
View file @
634cf9aa
...
...
@@ -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
.
_
get
_tmp_path
(
conn
)
tmp
=
self
.
_
make
_tmp_path
(
conn
)
result
=
None
if
self
.
module_name
==
'copy'
:
...
...
@@ -691,22 +691,20 @@ class Runner(object):
# *****************************************************
def
_
get
_tmp_path
(
self
,
conn
):
'''
gets
a temporary path on a remote box '''
def
_
make
_tmp_path
(
self
,
conn
):
'''
make and return
a temporary path on a remote box '''
basetmp
=
C
.
DEFAULT_REMOTE_TMP
if
self
.
remote_user
==
'root'
:
basetmp
=
"/var/tmp"
cmd
=
"mktemp -d
%
s/ansible.XXXXXX"
%
basetmp
basetmp
=
"/var/tmp"
basetmp
=
os
.
path
.
join
(
basetmp
,
'ansible-
%
s-
%
s'
%
(
time
.
time
(),
random
.
randint
(
0
,
2
**
48
)))
cmd
=
"mkdir -p
%
s"
%
basetmp
if
self
.
remote_user
!=
'root'
:
cmd
=
"mkdir -p
%
s &&
%
s"
%
(
basetmp
,
cmd
)
cmd
+=
" && chmod a+x
%
s"
%
basetmp
result
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
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
return
basetmp
# *****************************************************
...
...
@@ -720,7 +718,7 @@ class Runner(object):
if
not
os
.
path
.
exists
(
in_path
):
raise
errors
.
AnsibleFileNotFound
(
"module not found:
%
s"
%
in_path
)
out_path
=
tmp
+
module
out_path
=
os
.
path
.
join
(
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