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): ...@@ -1084,6 +1084,7 @@ def hateoas_partitions(partition_reference):
partition = execute_db('partition', 'SELECT * FROM %s WHERE partition_reference=?', [partition_reference], one=True) partition = execute_db('partition', 'SELECT * FROM %s WHERE partition_reference=?', [partition_reference], one=True)
if partition is None: if partition is None:
abort(404) abort(404)
# my_slap_state corresponds to requested_state, not slap_state.
return { return {
'_embedded': { '_embedded': {
'_view': { '_view': {
...@@ -1100,7 +1101,7 @@ def hateoas_partitions(partition_reference): ...@@ -1100,7 +1101,7 @@ def hateoas_partitions(partition_reference):
'my_slap_state': { 'my_slap_state': {
'type': 'StringField', 'type': 'StringField',
'key': 'slap_state', 'key': 'slap_state',
'default': partition['slap_state'], 'default': partition['requested_state'],
}, },
'my_text_content': { 'my_text_content': {
'type': 'StringField', 'type': 'StringField',
......
...@@ -1298,7 +1298,7 @@ class TestCliInformation(CliMasterMixin): ...@@ -1298,7 +1298,7 @@ class TestCliInformation(CliMasterMixin):
json.loads(output0), json.loads(output0),
{ {
"software-url": "http://sr0//", "software-url": "http://sr0//",
"requested-state": "busy", "requested-state": "started",
"instance-parameters": {}, "instance-parameters": {},
"connection-parameters": {}, "connection-parameters": {},
"status": "unsupported", "status": "unsupported",
...@@ -1309,7 +1309,7 @@ class TestCliInformation(CliMasterMixin): ...@@ -1309,7 +1309,7 @@ class TestCliInformation(CliMasterMixin):
json.loads(output1), json.loads(output1),
{ {
"software-url": "http://sr1//", "software-url": "http://sr1//",
"requested-state": "busy", "requested-state": "started",
"instance-parameters": {"couscous": "hello"}, "instance-parameters": {"couscous": "hello"},
"connection-parameters": {}, "connection-parameters": {},
"status": "unsupported", "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