Commit 60f6c5e8 authored by Hemna's avatar Hemna
Browse files

Ignore already deleted lease

When we try and release a lease, we might get an object not found
exception meaning that the lease doesn't exist.  So there is no need
to release something that doesn't exist.

Change-Id: I7912a7adf95f97074ee41441d7bfb8d2405b6533
parent b75a126e
......@@ -556,6 +556,10 @@ class VmdkWriteHandle(VmdkHandle):
"""
try:
self._release_lease()
except exceptions.ManagedObjectNotFoundException:
LOG.info("Lease for %(url)s not found. No need to release.",
{'url': self._url})
return
except exceptions.VimException:
LOG.warning("Error occurred while releasing the lease "
"for %s.",
......@@ -637,6 +641,10 @@ class VmdkReadHandle(VmdkHandle):
"""
try:
self._release_lease()
except exceptions.ManagedObjectNotFoundException:
LOG.info("Lease for %(url)s not found. No need to release.",
{'url': self._url})
return
except exceptions.VimException:
LOG.warning("Error occurred while releasing the lease "
"for %s.",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment