Ensure retry on stale resources for exclude list updates
Change-Id: I075243c5a946ba03178f0d1e36c7d6b74819af88
This commit is contained in:
parent
4a47faeea8
commit
0d5da8224c
@ -227,15 +227,27 @@ class NsxLibNsGroup(utils.NsxLibApiBase):
|
|||||||
class NsxLibFirewallSection(utils.NsxLibApiBase):
|
class NsxLibFirewallSection(utils.NsxLibApiBase):
|
||||||
|
|
||||||
def add_member_to_fw_exclude_list(self, target_id, target_type):
|
def add_member_to_fw_exclude_list(self, target_id, target_type):
|
||||||
resource = 'firewall/excludelist?action=add_member'
|
@utils.retry_upon_exception(
|
||||||
body = {"target_id": target_id,
|
exceptions.StaleRevision,
|
||||||
"target_type": target_type}
|
max_attempts=self.nsxlib_config.max_attempts)
|
||||||
self.client.create(resource, body)
|
def _add_member_to_fw_exclude_list():
|
||||||
|
resource = 'firewall/excludelist?action=add_member'
|
||||||
|
body = {"target_id": target_id,
|
||||||
|
"target_type": target_type}
|
||||||
|
self.client.create(resource, body)
|
||||||
|
|
||||||
|
_add_member_to_fw_exclude_list()
|
||||||
|
|
||||||
def remove_member_from_fw_exclude_list(self, target_id, target_type):
|
def remove_member_from_fw_exclude_list(self, target_id, target_type):
|
||||||
resource = ('firewall/excludelist?action=remove_member&object_id='
|
@utils.retry_upon_exception(
|
||||||
+ target_id)
|
exceptions.StaleRevision,
|
||||||
self.client.create(resource)
|
max_attempts=self.nsxlib_config.max_attempts)
|
||||||
|
def _remove_member_from_fw_exclude_list():
|
||||||
|
resource = ('firewall/excludelist?action=remove_member&object_id='
|
||||||
|
+ target_id)
|
||||||
|
self.client.create(resource)
|
||||||
|
|
||||||
|
_remove_member_from_fw_exclude_list()
|
||||||
|
|
||||||
def get_excludelist(self):
|
def get_excludelist(self):
|
||||||
return self.client.list('firewall/excludelist')
|
return self.client.list('firewall/excludelist')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user