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
Roque
slapos.core
Commits
f94eef59
Commit
f94eef59
authored
Mar 20, 2023
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proxy: Fix hateoas for requested state
parent
843ec6e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
slapos/proxy/views.py
slapos/proxy/views.py
+2
-1
slapos/tests/test_slapproxy.py
slapos/tests/test_slapproxy.py
+2
-2
No files found.
slapos/proxy/views.py
View file @
f94eef59
...
...
@@ -1084,6 +1084,7 @@ def hateoas_partitions(partition_reference):
partition
=
execute_db
(
'partition'
,
'SELECT * FROM %s WHERE partition_reference=?'
,
[
partition_reference
],
one
=
True
)
if
partition
is
None
:
abort
(
404
)
# my_slap_state corresponds to requested_state, not slap_state.
return
{
'_embedded'
:
{
'_view'
:
{
...
...
@@ -1100,7 +1101,7 @@ def hateoas_partitions(partition_reference):
'my_slap_state'
:
{
'type'
:
'StringField'
,
'key'
:
'slap_state'
,
'default'
:
partition
[
'
slap
_state'
],
'default'
:
partition
[
'
requested
_state'
],
},
'my_text_content'
:
{
'type'
:
'StringField'
,
...
...
slapos/tests/test_slapproxy.py
View file @
f94eef59
...
...
@@ -1298,7 +1298,7 @@ class TestCliInformation(CliMasterMixin):
json
.
loads
(
output0
),
{
"software-url"
:
"http://sr0//"
,
"requested-state"
:
"
busy
"
,
"requested-state"
:
"
started
"
,
"instance-parameters"
:
{},
"connection-parameters"
:
{},
"status"
:
"unsupported"
,
...
...
@@ -1309,7 +1309,7 @@ class TestCliInformation(CliMasterMixin):
json
.
loads
(
output1
),
{
"software-url"
:
"http://sr1//"
,
"requested-state"
:
"
busy
"
,
"requested-state"
:
"
started
"
,
"instance-parameters"
:
{
"couscous"
:
"hello"
},
"connection-parameters"
:
{},
"status"
:
"unsupported"
,
...
...
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