Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
slapos
Commits
aeb740cd
Commit
aeb740cd
authored
5 years ago
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow newlines and other control characters in JSON parameter string
parent
b53ba563
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
slapos/recipe/promise_plugin.py
slapos/recipe/promise_plugin.py
+1
-1
slapos/test/recipe/test_plugin.py
slapos/test/recipe/test_plugin.py
+2
-2
No files found.
slapos/recipe/promise_plugin.py
View file @
aeb740cd
...
...
@@ -35,7 +35,7 @@ import json
import sys
sys.path[0:0] = %(path)s
extra_config_dict = json.loads("""%(config)s""")
extra_config_dict = json.loads("""%(config)s"""
, strict=False
)
# We want to cleanup all imported modules from slapos namespace, because
# they will conflict with slapos.core.
...
...
This diff is collapsed.
Click to expand it.
slapos/test/recipe/test_plugin.py
View file @
aeb740cd
...
...
@@ -44,7 +44,7 @@ in multi line
param3
=
self
.
options
[
'config-param3'
],
param4
=
self
.
options
[
'config-param4'
],
)
self
.
assertIn
(
'extra_config_dict = json.loads("""%s""")'
%
json
.
dumps
(
expected_dict
,
indent
=
2
,
sort_keys
=
True
),
content
)
self
.
assertIn
(
'extra_config_dict = json.loads("""%s"""
, strict=False
)'
%
json
.
dumps
(
expected_dict
,
indent
=
2
,
sort_keys
=
True
),
content
)
def
test_no_module_set
(
self
):
recipe
=
makeRecipe
(
...
...
@@ -67,7 +67,7 @@ in multi line
with
open
(
self
.
output
)
as
f
:
content
=
f
.
read
()
self
.
assertIn
(
"from slapos.promise.plugin.check_site_available import RunPromise"
,
content
)
self
.
assertIn
(
'extra_config_dict = json.loads("""{}""")'
,
content
)
self
.
assertIn
(
'extra_config_dict = json.loads("""{}"""
, strict=False
)'
,
content
)
def
test_bad_parameters
(
self
):
...
...
This diff is collapsed.
Click to expand it.
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