Merge "Add retry logic when deleting logical port and logical switch"

This commit is contained in:
Jenkins 2016-01-28 01:47:25 +00:00 committed by Gerrit Code Review
commit af04a5ee7c
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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)