Commit f94eef59 authored by Xavier Thompson's avatar Xavier Thompson

proxy: Fix hateoas for requested state

parent 843ec6e4
......@@ -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',
......
......@@ -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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment