Revert "Fix removal of tier0_path of a tier1"

This reverts commit ea4bcd61d8.
As of now, empty string causes realization error. Backend might
choose to fix this by allowing null value. Meanwhile, realization
error seems more disruptive than having tier0_path set when its
not supposed to be set (which doesn't break vmware_nsx CI)

Change-Id: I0551f2330b692a0c818c293d5fe6bf74436ac711
This commit is contained in:
Anna Khmelnitsky 2019-03-22 21:30:01 +00:00
parent 0d173ec3f5
commit f91887541b
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.assertEqual("", actual_def.get_obj_dict()['tier0_path'])
self.assertIsNone(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 = ""
tier0_path = None
if tier0:
tenant = TENANTS_PATH_PATTERN % self.get_tenant()
tier0_path = "/%stier-0s/%s" % (tenant, tier0)