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
ec6f488d
Commit
ec6f488d
authored
Mar 30, 2012
by
Matthew Williams
Committed by
Michael DeHaan
Mar 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell quoting fixes
(edited author's original commit comment -- MPD)
parent
99d57966
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
lib/ansible/playbook.py
+1
-1
lib/ansible/utils.py
+10
-3
No files found.
lib/ansible/playbook.py
View file @
ec6f488d
...
@@ -293,7 +293,7 @@ class PlayBook(object):
...
@@ -293,7 +293,7 @@ class PlayBook(object):
async_seconds
=
int
(
task
.
get
(
'async'
,
0
))
# not async by default
async_seconds
=
int
(
task
.
get
(
'async'
,
0
))
# not async by default
async_poll_interval
=
int
(
task
.
get
(
'poll'
,
10
))
# default poll = 10 seconds
async_poll_interval
=
int
(
task
.
get
(
'poll'
,
10
))
# default poll = 10 seconds
tokens
=
shlex
.
split
(
action
)
tokens
=
shlex
.
split
(
action
,
posix
=
False
)
module_name
=
tokens
[
0
]
module_name
=
tokens
[
0
]
module_args
=
tokens
[
1
:]
module_args
=
tokens
[
1
:]
...
...
lib/ansible/utils.py
View file @
ec6f488d
...
@@ -260,12 +260,19 @@ def parse_yaml_from_file(path):
...
@@ -260,12 +260,19 @@ def parse_yaml_from_file(path):
raise
errors
.
AnsibleError
(
"file not found:
%
s"
%
path
)
raise
errors
.
AnsibleError
(
"file not found:
%
s"
%
path
)
return
parse_yaml
(
data
)
return
parse_yaml
(
data
)
def
parse_kv
(
args
):
def
unquote_string
(
string
):
''' remove single or double quotes from beginning/end of string'''
if
(
string
.
startswith
(
'"'
)
and
string
.
endswith
(
'"'
))
or
\
(
string
.
startswith
(
"'"
)
and
string
.
endswith
(
"'"
)):
return
string
[
1
:
-
1
]
else
:
return
string
def
parse_kv
(
args
,
unquote
=
True
):
''' convert a string of key/value items to a dict '''
''' convert a string of key/value items to a dict '''
options
=
{}
options
=
{}
for
x
in
args
:
for
x
in
args
:
if
x
.
find
(
"="
)
!=
-
1
:
if
x
.
find
(
"="
)
!=
-
1
:
k
,
v
=
x
.
split
(
"="
)
k
,
v
=
x
.
split
(
"="
)
options
[
k
]
=
v
options
[
k
]
=
unquote_string
(
v
)
if
unquote
else
v
return
options
return
options
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