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
3fddd78e
Commit
3fddd78e
authored
Jan 27, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing traceback caused by incorrect argument passing to json.dumps
Fixes #5756
parent
79cefa1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
lib/ansible/runner/filter_plugins/core.py
+7
-3
lib/ansible/utils/template.py
+2
-0
No files found.
lib/ansible/runner/filter_plugins/core.py
View file @
3fddd78e
...
...
@@ -30,9 +30,13 @@ def to_nice_yaml(*a, **kw):
'''Make verbose, human readable yaml'''
return
yaml
.
safe_dump
(
*
a
,
indent
=
4
,
allow_unicode
=
True
,
default_flow_style
=
False
,
**
kw
)
def
to_nice_json
(
*
a
,
**
kw
):
def
to_json
(
a
,
*
args
,
**
kw
):
''' Convert the value to JSON '''
return
json
.
dumps
(
a
,
*
args
,
**
kw
)
def
to_nice_json
(
a
,
*
args
,
**
kw
):
'''Make verbose, human readable JSON'''
return
json
.
dumps
(
*
a
,
indent
=
4
,
sort_keys
=
True
,
**
kw
)
return
json
.
dumps
(
a
,
indent
=
4
,
sort_keys
=
True
,
*
args
,
**
kw
)
def
failed
(
*
a
,
**
kw
):
''' Test if task result yields failed '''
...
...
@@ -148,7 +152,7 @@ class FilterModule(object):
'b64encode'
:
base64
.
b64encode
,
# json
'to_json'
:
json
.
dumps
,
'to_json'
:
to_json
,
'to_nice_json'
:
to_nice_json
,
'from_json'
:
json
.
loads
,
...
...
lib/ansible/utils/template.py
View file @
3fddd78e
...
...
@@ -547,6 +547,8 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
except
TypeError
,
te
:
if
'StrictUndefined'
in
str
(
te
):
raise
errors
.
AnsibleUndefinedVariable
(
"unable to look up a name or access an attribute in template string"
)
else
:
raise
errors
.
AnsibleError
(
"an unexpected type error occured. Error was
%
s"
%
te
)
return
res
except
(
jinja2
.
exceptions
.
UndefinedError
,
errors
.
AnsibleUndefinedVariable
):
if
fail_on_undefined
:
...
...
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