Browse Source

Merge "Allow Transaction for Policy IP Pool Deletion" into stable/victoria

changes/40/794440/2
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
17437c2cf0
  1. 15
      vmware_nsxlib/tests/unit/v3/policy/test_transaction.py
  2. 2
      vmware_nsxlib/v3/policy/core_resources.py

15
vmware_nsxlib/tests/unit/v3/policy/test_transaction.py

@ -164,6 +164,21 @@ class TestPolicyTransaction(policy_testcase.TestPolicyApi):
self.assert_infra_patch_call(expected_body)
def test_ip_address_pool_delete(self):
pool = {'id': 'pool1',
'resource_type': 'IpAddressPool'}
with trans.NsxPolicyTransaction():
self.policy_lib.ip_pool.delete(ip_pool_id=pool['id'])
expected_body = {'resource_type': 'Infra',
'children': [{'resource_type': 'ChildIpAddressPool',
'IpAddressPool': pool,
'marked_for_delete': True}]}
self.assert_infra_patch_call(expected_body)
def test_groups_only(self):
g1 = {'resource_type': 'Group', 'id': 'group1',

2
vmware_nsxlib/v3/policy/core_resources.py

@ -3251,7 +3251,7 @@ class NsxPolicyIpPoolApi(NsxPolicyResourceBase):
def delete(self, ip_pool_id, tenant=constants.POLICY_INFRA_TENANT):
ip_pool_def = self.entry_def(ip_pool_id=ip_pool_id,
tenant=tenant)
self._delete_with_retry(ip_pool_def)
self._delete_or_store(ip_pool_def)
def get(self, ip_pool_id, tenant=constants.POLICY_INFRA_TENANT,
silent=False):

Loading…
Cancel
Save