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
Eric Zheng
slapos.core
Commits
63a443e3
Commit
63a443e3
authored
Jul 28, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slap/request: emit a warning when requesting with parameters not matching schema. TODO test
parent
a0b6568a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
slapos/slap/slap.py
slapos/slap/slap.py
+14
-0
No files found.
slapos/slap/slap.py
View file @
63a443e3
...
@@ -266,6 +266,20 @@ class OpenOrder(SlapRequester):
...
@@ -266,6 +266,20 @@ class OpenOrder(SlapRequester):
'state'
:
dumps
(
state
),
'state'
:
dumps
(
state
),
'shared_xml'
:
dumps
(
shared
),
'shared_xml'
:
dumps
(
shared
),
}
}
import
warnings
import
jsonschema
from
..util
import
SoftwareReleaseSchema
try
:
SoftwareReleaseSchema
(
request_dict
[
'software_release'
],
request_dict
[
'software_type'
]
).
validateInstanceParameterDict
(
partition_parameter_kw
)
except
jsonschema
.
ValidationError
as
e
:
warnings
.
warn
(
"Request parameters do not validate against schema definition:
\
n
{e}"
.
format
(
e
=
e
),
UserWarning
,
)
return
self
.
_requestComputerPartition
(
request_dict
)
return
self
.
_requestComputerPartition
(
request_dict
)
def
getInformation
(
self
,
partition_reference
):
def
getInformation
(
self
,
partition_reference
):
...
...
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