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
a9948f97
Commit
a9948f97
authored
Mar 14, 2012
by
Seth Vidal
Committed by
Michael DeHaan
Mar 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert runner to use an args file rather than just arguments passed
on the command line
parent
f6814254
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
lib/ansible/runner.py
+12
-2
No files found.
lib/ansible/runner.py
View file @
a9948f97
...
...
@@ -34,6 +34,7 @@ import random
import
jinja2
import
time
import
traceback
import
tempfile
# FIXME: stop importing *, use as utils/errors
from
ansible.utils
import
*
...
...
@@ -267,8 +268,17 @@ class Runner(object):
template
=
jinja2
.
Template
(
args
)
args
=
template
.
render
(
inject_vars
)
cmd
=
"
%
s
%
s"
%
(
remote_module_path
,
args
)
# make a tempfile for the args and stuff the args into the file
argsfd
,
argsfile
=
tempfile
.
mkstemp
()
argsfo
=
os
.
fdopen
(
argsfd
,
'w'
)
argsfo
.
write
(
args
)
argsfo
.
flush
()
argsfo
.
close
()
args_rem
=
tmp
+
'argsfile'
self
.
remote_log
(
conn
,
"args:
%
s"
%
args
)
self
.
_transfer_file
(
conn
,
argsfile
,
args_rem
)
os
.
unlink
(
argsfile
)
cmd
=
"
%
s
%
s"
%
(
remote_module_path
,
args_rem
)
result
=
self
.
_exec_command
(
conn
,
cmd
)
return
result
...
...
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