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
d6e6d2a6
Commit
d6e6d2a6
authored
Sep 11, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove regex related to baby-JSON parsing only.
parent
22dbb65b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
4 deletions
+1
-4
lib/ansible/utils/__init__.py
+1
-2
test/units/TestUtils.py
+0
-2
No files found.
lib/ansible/utils/__init__.py
View file @
d6e6d2a6
...
@@ -1129,11 +1129,10 @@ def filter_leading_non_json_lines(buf):
...
@@ -1129,11 +1129,10 @@ def filter_leading_non_json_lines(buf):
filter only leading lines since multiline JSON is valid.
filter only leading lines since multiline JSON is valid.
'''
'''
kv_regex
=
re
.
compile
(
r'\w=\w'
)
filtered_lines
=
StringIO
.
StringIO
()
filtered_lines
=
StringIO
.
StringIO
()
stop_filtering
=
False
stop_filtering
=
False
for
line
in
buf
.
splitlines
():
for
line
in
buf
.
splitlines
():
if
stop_filtering
or
line
.
startswith
(
'{'
)
or
line
.
startswith
(
'['
)
or
kv_regex
.
search
(
line
)
:
if
stop_filtering
or
line
.
startswith
(
'{'
)
or
line
.
startswith
(
'['
):
stop_filtering
=
True
stop_filtering
=
True
filtered_lines
.
write
(
line
+
'
\n
'
)
filtered_lines
.
write
(
line
+
'
\n
'
)
return
filtered_lines
.
getvalue
()
return
filtered_lines
.
getvalue
()
...
...
test/units/TestUtils.py
View file @
d6e6d2a6
...
@@ -453,8 +453,6 @@ class TestUtils(unittest.TestCase):
...
@@ -453,8 +453,6 @@ class TestUtils(unittest.TestCase):
'{"foo": "bar"}
\n
'
)
'{"foo": "bar"}
\n
'
)
self
.
assertEqual
(
ansible
.
utils
.
filter_leading_non_json_lines
(
'a
\n
b
\n
ansible!
\n
["foo", "bar"]'
),
self
.
assertEqual
(
ansible
.
utils
.
filter_leading_non_json_lines
(
'a
\n
b
\n
ansible!
\n
["foo", "bar"]'
),
'["foo", "bar"]
\n
'
)
'["foo", "bar"]
\n
'
)
self
.
assertEqual
(
ansible
.
utils
.
filter_leading_non_json_lines
(
'a
\n
b
\n
ansible!
\n
foo=bar'
),
'foo=bar
\n
'
)
def
test_boolean
(
self
):
def
test_boolean
(
self
):
self
.
assertEqual
(
ansible
.
utils
.
boolean
(
"true"
),
True
)
self
.
assertEqual
(
ansible
.
utils
.
boolean
(
"true"
),
True
)
...
...
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