Merge "Ensure service when creating T1 service interface"
This commit is contained in:
commit
a05156dfb9
@ -2716,6 +2716,11 @@ class TestPolicyTier1(NsxPolicyLibTestCase):
|
|||||||
ipv6_ndra_profile_id=ndra_profile,
|
ipv6_ndra_profile_id=ndra_profile,
|
||||||
tenant=TEST_TENANT)
|
tenant=TEST_TENANT)
|
||||||
|
|
||||||
|
verify_def = core_defs.Tier1LocaleServiceDef(
|
||||||
|
tier1_id=tier1_id,
|
||||||
|
service_id=self.resourceApi._locale_service_id(tier1_id),
|
||||||
|
tenant=TEST_TENANT)
|
||||||
|
|
||||||
expected_def = core_defs.Tier1InterfaceDef(
|
expected_def = core_defs.Tier1InterfaceDef(
|
||||||
tier1_id=tier1_id,
|
tier1_id=tier1_id,
|
||||||
service_id=self.resourceApi._locale_service_id(tier1_id),
|
service_id=self.resourceApi._locale_service_id(tier1_id),
|
||||||
@ -2725,7 +2730,8 @@ class TestPolicyTier1(NsxPolicyLibTestCase):
|
|||||||
ipv6_ndra_profile_id=ndra_profile,
|
ipv6_ndra_profile_id=ndra_profile,
|
||||||
tenant=TEST_TENANT)
|
tenant=TEST_TENANT)
|
||||||
|
|
||||||
self.assert_called_with_def(api_call, expected_def)
|
self.assert_called_with_def(api_call, verify_def)
|
||||||
|
self.assert_called_with_def(api_call, expected_def, 1)
|
||||||
|
|
||||||
def test_remove_router_interface(self):
|
def test_remove_router_interface(self):
|
||||||
tier1_id = '111'
|
tier1_id = '111'
|
||||||
|
@ -998,6 +998,14 @@ class NsxPolicyTier1Api(NsxPolicyResourceBase):
|
|||||||
# with the same id as the router id with a constant suffix
|
# with the same id as the router id with a constant suffix
|
||||||
return tier1_id + self.LOCALE_SERVICE_SUFF
|
return tier1_id + self.LOCALE_SERVICE_SUFF
|
||||||
|
|
||||||
|
def _ensure_locale_service(self, tier1_id,
|
||||||
|
tenant=constants.POLICY_INFRA_TENANT):
|
||||||
|
t1service_def = core_defs.Tier1LocaleServiceDef(
|
||||||
|
tier1_id=tier1_id,
|
||||||
|
service_id=self._locale_service_id(tier1_id),
|
||||||
|
tenant=tenant)
|
||||||
|
self.policy_api.create_or_update(t1service_def)
|
||||||
|
|
||||||
def set_edge_cluster_path(self, tier1_id, edge_cluster_path,
|
def set_edge_cluster_path(self, tier1_id, edge_cluster_path,
|
||||||
tenant=constants.POLICY_INFRA_TENANT):
|
tenant=constants.POLICY_INFRA_TENANT):
|
||||||
t1service_def = core_defs.Tier1LocaleServiceDef(
|
t1service_def = core_defs.Tier1LocaleServiceDef(
|
||||||
@ -1030,6 +1038,8 @@ class NsxPolicyTier1Api(NsxPolicyResourceBase):
|
|||||||
def add_segment_interface(self, tier1_id, interface_id, segment_id,
|
def add_segment_interface(self, tier1_id, interface_id, segment_id,
|
||||||
subnets, ipv6_ndra_profile_id=IGNORE,
|
subnets, ipv6_ndra_profile_id=IGNORE,
|
||||||
tenant=constants.POLICY_INFRA_TENANT):
|
tenant=constants.POLICY_INFRA_TENANT):
|
||||||
|
self._ensure_locale_service(tier1_id, tenant)
|
||||||
|
|
||||||
t1interface_def = core_defs.Tier1InterfaceDef(
|
t1interface_def = core_defs.Tier1InterfaceDef(
|
||||||
tier1_id=tier1_id,
|
tier1_id=tier1_id,
|
||||||
service_id=self._locale_service_id(tier1_id),
|
service_id=self._locale_service_id(tier1_id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user