Merge "Add retry logic when deleting logical port and logical switch"
This commit is contained in:
commit
af04a5ee7c
@ -90,6 +90,8 @@ def create_logical_switch(display_name, transport_zone_id, tags,
|
||||
return client.create_resource(resource, body)
|
||||
|
||||
|
||||
@utils.retry_upon_exception_nsxv3(nsx_exc.StaleRevision,
|
||||
max_attempts=cfg.CONF.nsx_v3.retries)
|
||||
def delete_logical_switch(lswitch_id):
|
||||
resource = 'logical-switches/%s?detach=true&cascade=true' % lswitch_id
|
||||
client.delete_resource(resource)
|
||||
|
@ -261,6 +261,9 @@ class LogicalPort(AbstractRESTResource):
|
||||
attachment=attachment))
|
||||
return self._client.create(body=body)
|
||||
|
||||
@utils.retry_upon_exception_nsxv3(
|
||||
nsx_exc.StaleRevision,
|
||||
max_attempts=cfg.CONF.nsx_v3.retries)
|
||||
def delete(self, lport_id):
|
||||
return self._client.url_delete('%s?detach=true' % lport_id)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user