Support update tier0 in policy tier1 router

Change-Id: I6de8a97dcabacbbccca79ba03ece762f94b7a6fe
This commit is contained in:
Adit Sarfaty 2018-11-07 13:52:03 +02:00
parent 7ebdb64283
commit 7b8b4ddad6
2 changed files with 6 additions and 3 deletions

View File

@ -1608,13 +1608,15 @@ class TestPolicyTier1(NsxPolicyLibTestCase):
def test_update(self):
id = '111'
name = 'new name'
tier0 = 'tier0'
with mock.patch.object(self.policy_api,
"create_or_update") as update_call:
self.resourceApi.update(id,
name=name,
name=name, tier0=tier0,
tenant=TEST_TENANT)
expected_def = policy_defs.Tier1Def(tier1_id=id,
name=name,
tier0=tier0,
tenant=TEST_TENANT)
self.assert_called_with_def(
update_call, expected_def)

View File

@ -563,15 +563,16 @@ class NsxPolicyTier1Api(NsxPolicyResourceBase):
def update(self, tier1_id, name=None, description=None,
force_whitelisting=None,
failover_mode=None,
failover_mode=None, tier0=None,
tags=None,
tenant=policy_constants.POLICY_INFRA_TENANT):
# TODO(asarfaty): Support tier0=None fore reseting the tier0 value
self._update(tier1_id=tier1_id,
name=name,
description=description,
force_whitelisting=force_whitelisting,
failover_mode=failover_mode,
tier0=tier0,
tags=tags,
tenant=tenant)