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
This commit is contained in:
parent
b75a126ec6
commit
60f6c5e8f5
|
@ -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.",
|
||||
|
|
Loading…
Reference in New Issue