Browse Source

Merge "bay-show doesn't return stack_id"

changes/99/262099/1
Jenkins 5 years ago
committed by Gerrit Code Review
parent
commit
a859b00596
2 changed files with 9 additions and 4 deletions
  1. +6
    -1
      magnum/api/controllers/v1/bay.py
  2. +3
    -3
      magnum/tests/unit/api/controllers/v1/test_bay.py

+ 6
- 1
magnum/api/controllers/v1/bay.py View File

@ -93,6 +93,9 @@ class Bay(base.APIBase):
links = wsme.wsattr([link.Link], readonly=True)
"""A list containing a self link and associated bay links"""
stack_id = wsme.wsattr(wtypes.text, readonly=True)
"""Stack id of the heat stack"""
status = wtypes.text
"""Status of the bay from the heat stack"""
@ -127,7 +130,8 @@ class Bay(base.APIBase):
if not expand:
bay.unset_fields_except(['uuid', 'name', 'baymodel_id',
'node_count', 'status',
'bay_create_timeout', 'master_count'])
'bay_create_timeout', 'master_count',
'stack_id'])
bay.links = [link.Link.make_link('self', url,
'bays', bay.uuid),
@ -149,6 +153,7 @@ class Bay(base.APIBase):
node_count=2,
master_count=1,
bay_create_timeout=15,
stack_id='49dc23f5-ffc9-40c3-9d34-7be7f9e34d63',
status="CREATE_COMPLETE",
status_reason="CREATE completed successfully",
api_address='172.24.4.3',


+ 3
- 3
magnum/tests/unit/api/controllers/v1/test_bay.py View File

@ -66,7 +66,7 @@ class TestListBay(api_base.FunctionalTest):
self.assertEqual(bay.uuid, response['uuid'])
for key in ("name", "baymodel_id", "node_count", "status",
"api_address", "discovery_url", "node_addresses",
"master_count", "master_addresses"):
"master_count", "master_addresses", "stack_id"):
self.assertIn(key, response)
def test_get_one_by_name(self):
@ -75,7 +75,7 @@ class TestListBay(api_base.FunctionalTest):
self.assertEqual(bay.uuid, response['uuid'])
for key in ("name", "baymodel_id", "node_count", "status",
"api_address", "discovery_url", "node_addresses",
"master_count", "master_addresses"):
"master_count", "master_addresses", "stack_id"):
self.assertIn(key, response)
def test_get_one_by_name_not_found(self):
@ -129,7 +129,7 @@ class TestListBay(api_base.FunctionalTest):
self.assertEqual(bay_list[-1].uuid, response['bays'][0]['uuid'])
for key in ("name", "baymodel_id", "node_count", "status",
"discovery_url", "api_address", "node_addresses",
"master_addresses"):
"master_addresses", "stack_id"):
self.assertIn(key, response['bays'][0])
def test_detail_against_single(self):


Loading…
Cancel
Save