Change Bay#status type to wtypes.Enum

Bay status is Enum value not types.Text.
This patch fixes this.

Change-Id: Ice418d0d5075ade01ad173fac629763f78871f7b
Closes-Bug: #1542162
This commit is contained in:
OTSUKA, Yuanying 2016-02-05 14:36:41 +09:00
parent 22d15557c8
commit 054dfa1100
1 changed files with 4 additions and 8 deletions

View File

@ -29,6 +29,7 @@ from magnum.api import utils as api_utils
from magnum.common import exception
from magnum.common import policy
from magnum import objects
from magnum.objects import fields
class BayPatchType(types.JsonPatchType):
@ -96,13 +97,8 @@ class Bay(base.APIBase):
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
Possible status is one of:
'CREATE_IN_PROGRESS', 'CREATE_FAILED', 'CREATE_COMPLETE',
'UPDATE_IN_PROGRESS', 'UPDATE_FAILED', 'UPDATE_COMPLETE',
'DELETE_IN_PROGRESS', 'DELETE_FAILED', 'DELETE_COMPLETE' """
status = wtypes.Enum(str, *fields.BayStatus.ALL)
"""Status of the bay from the heat stack"""
status_reason = wtypes.text
"""Status reason of the bay from the heat stack"""
@ -159,7 +155,7 @@ class Bay(base.APIBase):
master_count=1,
bay_create_timeout=15,
stack_id='49dc23f5-ffc9-40c3-9d34-7be7f9e34d63',
status="CREATE_COMPLETE",
status=fields.BayStatus.CREATE_COMPLETE,
status_reason="CREATE completed successfully",
api_address='172.24.4.3',
node_addresses=['172.24.4.4', '172.24.4.5'],