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
5a65dce6
Commit
5a65dce6
authored
Aug 30, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issues with csh redirection
parent
b525eedb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
lib/ansible/plugins/shell/csh.py
+1
-0
lib/ansible/plugins/shell/sh.py
+5
-4
No files found.
lib/ansible/plugins/shell/csh.py
View file @
5a65dce6
...
...
@@ -23,6 +23,7 @@ class ShellModule(ShModule):
# How to end lines in a python script one-liner
_SHELL_EMBEDDED_PY_EOL
=
'
\\\n
'
_SHELL_REDIRECT_ALLNULL
=
'>& /dev/null'
def
env_prefix
(
self
,
**
kwargs
):
return
'env
%
s'
%
super
(
ShellModule
,
self
)
.
env_prefix
(
**
kwargs
)
lib/ansible/plugins/shell/sh.py
View file @
5a65dce6
...
...
@@ -30,6 +30,7 @@ class ShellModule(object):
# How to end lines in a python script one-liner
_SHELL_EMBEDDED_PY_EOL
=
'
\n
'
_SHELL_REDIRECT_ALLNULL
=
'> /dev/null 2>&1'
def
env_prefix
(
self
,
**
kwargs
):
'''Build command prefix with environment variables.'''
...
...
@@ -53,10 +54,10 @@ class ShellModule(object):
def
remove
(
self
,
path
,
recurse
=
False
):
path
=
pipes
.
quote
(
path
)
cmd
=
'rm -f '
if
recurse
:
return
"rm -rf
%
s >/dev/null 2>&1"
%
path
else
:
return
"rm -f
%
s >/dev/null 2>&1"
%
path
cmd
+=
'-r '
return
cmd
+
"
%
s
%
s"
%
(
path
,
self
.
_SHELL_REDIRECT_ALLNULL
)
def
mkdtemp
(
self
,
basefile
=
None
,
system
=
False
,
mode
=
None
):
if
not
basefile
:
...
...
@@ -139,5 +140,5 @@ class ShellModule(object):
cmd_parts
=
[
env_string
.
strip
(),
shebang
.
replace
(
"#!"
,
""
)
.
strip
(),
cmd
]
new_cmd
=
" "
.
join
(
cmd_parts
)
if
rm_tmp
:
new_cmd
=
'
%
s; rm -rf "
%
s"
>/dev/null 2>&1'
%
(
new_cmd
,
rm_tmp
)
new_cmd
=
'
%
s; rm -rf "
%
s"
%
s'
%
(
new_cmd
,
rm_tmp
,
self
.
_SHELL_REDIRECT_ALLNULL
)
return
new_cmd
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