Fix removal of tier0_path of a tier1

The empty attribute should be '' instead of None

Change-Id: I6ac428db412688eb37c63944cd98efeac6a267ef
This commit is contained in:
Adit Sarfaty 2019-03-20 12:19:56 +02:00
parent 12a0b64171
commit ea4bcd61d8
2 changed files with 2 additions and 2 deletions

View File

@ -2079,7 +2079,7 @@ class TestPolicyTier1(NsxPolicyLibTestCase):
# make sure tier0 is in the body with value None
actual_def = update_call.call_args_list[0][0][0]
self.assertIn('tier0_path', actual_def.get_obj_dict())
self.assertIsNone(actual_def.get_obj_dict()['tier0_path'])
self.assertEqual("", actual_def.get_obj_dict()['tier0_path'])
def test_update_route_adv(self):
obj_id = '111'

View File

@ -354,7 +354,7 @@ class Tier1Def(RouterDef):
# TODO(annak): replace with provider path when provider is exposed
if self.has_attr('tier0'):
tier0 = self.get_attr('tier0')
tier0_path = None
tier0_path = ""
if tier0:
tenant = TENANTS_PATH_PATTERN % self.get_tenant()
tier0_path = "/%stier-0s/%s" % (tenant, tier0)