diff options
author | Javeme <zhangmei.li@easystack.cn> | 2016-02-17 20:05:01 +0800 |
---|---|---|
committer | Javeme <zhangmei.li@easystack.cn> | 2016-03-11 11:40:58 +0800 |
commit | 8ec8c094176f4cf45a8d5f99f99df924a5368bb2 (patch) | |
tree | e0b729a82691aefe66eddf83005cf7dafbb1b991 /oslo_vmware/rw_handles.py | |
parent | aef1f4a0a21d219ced4d5e87fea863a7f7cd99de (diff) | |
download | oslo-vmware-8ec8c094176f4cf45a8d5f99f99df924a5368bb2.tar.gz |
Should not raise Exception before connection close
Currently VmdkReadHandle.close() raises a VimException before
the read connection is closed, this patch let's add a `finally`
to close it.
Change-Id: Ib5b388f7eeb9f26de66c308a89f70c85ba6dc7a9
Diffstat (limited to 'oslo_vmware/rw_handles.py')
-rw-r--r-- | oslo_vmware/rw_handles.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/oslo_vmware/rw_handles.py b/oslo_vmware/rw_handles.py index 754dd17..36cec85 100644 --- a/oslo_vmware/rw_handles.py +++ b/oslo_vmware/rw_handles.py @@ -617,7 +617,8 @@ class VmdkReadHandle(FileHandle): self._url, exc_info=True) raise - super(VmdkReadHandle, self).close() + finally: + super(VmdkReadHandle, self).close() LOG.debug("Closed VMDK read handle for %s.", self._url) def __str__(self): |