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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
c984a567
Commit
c984a567
authored
Dec 12, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_json_rpc_api: drop not expected property in the output
parent
f89fc714
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
26 deletions
+17
-26
master/bt5/slapos_json_rpc_api/SkinTemplateItem/portal_skins/slapos_jio_api/ComputeNode_updateFromAPIDict.py
...tal_skins/slapos_jio_api/ComputeNode_updateFromAPIDict.py
+1
-1
master/bt5/slapos_json_rpc_api/TestTemplateItem/portal_components/test.erp5.testSlapOSJsonRpc.py
...lateItem/portal_components/test.erp5.testSlapOSJsonRpc.py
+16
-25
No files found.
master/bt5/slapos_json_rpc_api/SkinTemplateItem/portal_skins/slapos_jio_api/ComputeNode_updateFromAPIDict.py
View file @
c984a567
...
@@ -88,7 +88,7 @@ for key, value in existing_partition_dict.items():
...
@@ -88,7 +88,7 @@ for key, value in existing_partition_dict.items():
value
.
invalidate
(
comment
=
"Desactivated by slapformat"
)
value
.
invalidate
(
comment
=
"Desactivated by slapformat"
)
return
{
return
{
"$schema"
:
json_form
.
absolute_url
().
strip
()
+
"/getOutputJSONSchema"
,
#
"$schema": json_form.absolute_url().strip() + "/getOutputJSONSchema",
"compute_node_id"
:
compute_node
.
getReference
(),
"compute_node_id"
:
compute_node
.
getReference
(),
"date"
:
DateTime
().
ISO8601
(),
"date"
:
DateTime
().
ISO8601
(),
"portal_type"
:
"Compute Node"
,
"portal_type"
:
"Compute Node"
,
...
...
master/bt5/slapos_json_rpc_api/TestTemplateItem/portal_components/test.erp5.testSlapOSJsonRpc.py
View file @
c984a567
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
##############################################################################
##############################################################################
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
,
TemporaryAlarmScript
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
,
TemporaryAlarmScript
,
PinnedDateTime
from
DateTime
import
DateTime
from
DateTime
import
DateTime
...
@@ -1253,38 +1253,29 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJsonRpcMixin):
...
@@ -1253,38 +1253,29 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJsonRpcMixin):
self
.
person_user_id
=
self
.
person
.
getUserId
()
self
.
person_user_id
=
self
.
person
.
getUserId
()
def
test_30_computerBang
(
self
):
def
test_30_computerBang
(
self
):
start_date
=
DateTime
()
# XXX XXX XXX TODO pin datetime to check the result
error_log
=
'Please force slapos node rerun'
error_log
=
'Please force slapos node rerun'
response
=
self
.
callJsonRpcWebService
(
with
PinnedDateTime
(
self
,
DateTime
(
'2020/05/19'
)):
"slapos.put.slapos_jio_api_put_compute_node"
,
response
=
self
.
callJsonRpcWebService
(
{
"slapos.put.slapos_jio_api_put_compute_node"
,
"compute_node_id"
:
self
.
compute_node_id
,
{
"portal_type"
:
"Compute Node"
,
"compute_node_id"
:
self
.
compute_node_id
,
"bang_status_message"
:
error_log
,
"portal_type"
:
"Compute Node"
,
}
,
"bang_status_message"
:
error_log
,
self
.
person_user_id
},
)
self
.
person_user_id
response_dict
=
json
.
loads
(
response
.
getBody
()
)
)
self
.
assertEqual
(
'application/json'
,
response
.
headers
.
get
(
'content-type'
))
self
.
assertEqual
(
'application/json'
,
response
.
headers
.
get
(
'content-type'
))
"""
self
.
assertEqual
(
self
.
assertEqual
(
response
.
getBody
(),
response
.
getBody
(),
json
.
dumps
(
json
.
dumps
(
{
{
'type': 'success-type',
'compute_node_id'
:
self
.
compute_node
.
getReference
(),
'title': "query completed",
'date'
:
'2020-05-19T00:00:00+00:00'
,
'status': 200
'portal_type'
:
'Compute Node'
,
}).encode())"""
'success'
:
'Done'
}).
encode
())
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertEqual
(
response_dict
[
"compute_node_id"
],
self
.
compute_node
.
getReference
().
decode
(
'UTF-8'
))
self
.
assertEqual
(
response_dict
[
"success"
],
"Done"
)
self
.
assertEqual
(
response_dict
[
"portal_type"
],
"Compute Node"
)
self
.
assertTrue
(
response_dict
[
"$schema"
].
endswith
(
"ComputeNode_updateFromJSON/getOutputJSONSchema"
))
self
.
assertTrue
(
DateTime
(
response_dict
[
"date"
])
>=
DateTime
(
start_date
.
ISO8601
()),
response_dict
[
"date"
])
portal_workflow
=
self
.
portal
.
portal_workflow
portal_workflow
=
self
.
portal
.
portal_workflow
comment
=
portal_workflow
.
getInfoFor
(
ob
=
self
.
compute_node
,
comment
=
portal_workflow
.
getInfoFor
(
ob
=
self
.
compute_node
,
name
=
'comment'
,
name
=
'comment'
,
...
...
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