Correct SegmentPort init_state enum

VIF_RESTORE to RESTORE_VIF

Change-Id: I12470d6ad96a263a6e7adb98aa397f3f9c652ebc
This commit is contained in:
Ran Gu 2020-07-02 16:16:56 +08:00
parent cc782b4d10
commit 175f5faca4
3 changed files with 4 additions and 4 deletions

View File

@ -4650,7 +4650,7 @@ class TestPolicySegmentPort(NsxPolicyLibTestCase):
tags = [{'scope': 'a', 'tag': 'b'}]
hyperbus_mode = 'DISABLE'
admin_state = True
init_state = 'VIF_RESTORE'
init_state = 'RESTORE_VIF'
with mock.patch.object(
self.policy_api, "create_or_update") as api_call, \
@ -4702,7 +4702,7 @@ class TestPolicySegmentPort(NsxPolicyLibTestCase):
allocate_addresses = "BOTH"
tags = [{'scope': 'a', 'tag': 'b'}]
hyperbus_mode = 'DISABLE'
init_state = 'VIF_RESTORE'
init_state = 'RESTORE_VIF'
with mock.patch.object(
self.policy_api, "create_or_update") as api_call, \

View File

@ -35,7 +35,7 @@ ALLOCATE_ADDRESS_NONE = "None"
# SegmentPort init_state types
INIT_STATE_UNBLOCKED_VLAN = 'UNBLOCKED_VLAN'
INIT_STATE_VIF_RESTORE = 'VIF_RESTORE'
INIT_STATE_RESTORE_VIF = 'RESTORE_VIF'
# NSXv3 L2 Gateway constants
BRIDGE_ENDPOINT = "BRIDGEENDPOINT"

View File

@ -1156,7 +1156,7 @@ class SegmentPortDef(ResourceDef):
if (self.has_attr('init_state') and
self._version_dependant_attr_supported('init_state')):
valid_list = [nsx_constants.INIT_STATE_UNBLOCKED_VLAN,
nsx_constants.INIT_STATE_VIF_RESTORE]
nsx_constants.INIT_STATE_RESTORE_VIF]
init_state = self.get_attr('init_state')
if init_state not in valid_list:
raise exceptions.InvalidInput(