Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Cédric Le Ninivin
slapos.core
Commits
109b4258
Commit
109b4258
authored
May 24, 2022
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio_api_style: Instance parameter is expected in JSON
parent
c799a8cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/jIOWebSection_requestComputerPartitionFromJSON.xml
...lables/jIOWebSection_requestComputerPartitionFromJSON.xml
+2
-2
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_requestComputerPartition.py
.../slapos_jio_api/jIOWebSection_requestComputerPartition.py
+9
-7
No files found.
master/bt5/slapos_jio_api_style/PathTemplateItem/portal_callables/jIOWebSection_requestComputerPartitionFromJSON.xml
View file @
109b4258
...
@@ -60,8 +60,8 @@
...
@@ -60,8 +60,8 @@
},\n
},\n
"parameters": {\n
"parameters": {\n
"title": "Instance Parameters",\n
"title": "Instance Parameters",\n
"type": "
object
",\n
"type": "
string
",\n
"
additionalProperties": { "type": "string" }
\n
"
description": "Instance parameters in JSON Format."
\n
},\n
},\n
"shared": {\n
"shared": {\n
"title": "Shared Instance",\n
"title": "Shared Instance",\n
...
...
master/bt5/slapos_jio_api_style/SkinTemplateItem/portal_skins/slapos_jio_api/jIOWebSection_requestComputerPartition.py
View file @
109b4258
...
@@ -88,8 +88,8 @@ def getSoftwareInstanceForComputePartition(compute_node_id,
...
@@ -88,8 +88,8 @@ def getSoftwareInstanceForComputePartition(compute_node_id,
# Loads partition parameter
# Loads partition parameter
partition_parameter
=
data_dict
.
get
(
"parameters"
,
{}
)
partition_parameter
=
data_dict
.
get
(
"parameters"
,
None
)
if
isinstance
(
partition_parameter
,
str
)
:
if
partition_parameter
:
import
json
import
json
try
:
try
:
partition_parameter
=
json
.
loads
(
partition_parameter
)
partition_parameter
=
json
.
loads
(
partition_parameter
)
...
@@ -99,11 +99,13 @@ if isinstance(partition_parameter, str):
...
@@ -99,11 +99,13 @@ if isinstance(partition_parameter, str):
error_name
=
"CANNOT-DECODE-COMPUTER-PARTITION-JSON-PARAMETER"
,
error_name
=
"CANNOT-DECODE-COMPUTER-PARTITION-JSON-PARAMETER"
,
)
)
if
not
isinstance
(
partition_parameter
,
dict
):
if
not
isinstance
(
partition_parameter
,
dict
):
return
logError
(
return
logError
(
"Parameters should be a key value object."
,
"Parameters should be a key value object."
,
error_name
=
"INCORRECT-COMPUTER-PARTITION-JSON-PARAMETER"
,
error_name
=
"INCORRECT-COMPUTER-PARTITION-JSON-PARAMETER"
,
)
)
else
:
partition_parameter
=
{}
try
:
try
:
# filter dict
# filter dict
...
...
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