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
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
aeb740cd
Commit
aeb740cd
authored
Feb 20, 2019
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
Hide 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
...
@@ -35,7 +35,7 @@ import json
import sys
import sys
sys.path[0:0] = %(path)s
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
# We want to cleanup all imported modules from slapos namespace, because
# they will conflict with slapos.core.
# they will conflict with slapos.core.
...
...
slapos/test/recipe/test_plugin.py
View file @
aeb740cd
...
@@ -44,7 +44,7 @@ in multi line
...
@@ -44,7 +44,7 @@ in multi line
param3
=
self
.
options
[
'config-param3'
],
param3
=
self
.
options
[
'config-param3'
],
param4
=
self
.
options
[
'config-param4'
],
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
):
def
test_no_module_set
(
self
):
recipe
=
makeRecipe
(
recipe
=
makeRecipe
(
...
@@ -67,7 +67,7 @@ in multi line
...
@@ -67,7 +67,7 @@ in multi line
with
open
(
self
.
output
)
as
f
:
with
open
(
self
.
output
)
as
f
:
content
=
f
.
read
()
content
=
f
.
read
()
self
.
assertIn
(
"from slapos.promise.plugin.check_site_available import RunPromise"
,
content
)
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
):
def
test_bad_parameters
(
self
):
...
...
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