Change in vdsm[ovirt-3.3]: hsm: Do not hide errors when checking device visibility

nsoffer at redhat.com nsoffer at redhat.com
Sun Mar 2 13:39:20 UTC 2014


Hello Ayal Baron,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/25242

to review the following change.

Change subject: hsm: Do not hide errors when checking device visibility
......................................................................

hsm: Do not hide errors when checking device visibility

When checking devices visibility, all errors from os.stat() are treated
as "device does not exists", hiding fatal error and making it harder to
debug and fix them.

This patch handle only ENOENT for checking visibility and raise other
errors we cannot handle.

Change-Id: I7411d7d2eaa9172f612fd1b1e04177bef270ab19
Relates-To: https://bugzilla.redhat.com/923773
Bug-Url: https://bugzilla.redhat.com/1066413
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21211
Reviewed-by: Ayal Baron <abaron at redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/25242/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 9ab2168..d48890b 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -1994,7 +1994,9 @@
             try:
                 res = (os.stat('/dev/mapper/' + guid).st_mode &
                        stat.S_IRUSR != 0)
-            except:
+            except OSError as e:
+                if e.errno != errno.ENOENT:
+                    raise
                 res = False
             return res
 


-- 
To view, visit http://gerrit.ovirt.org/25242
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7411d7d2eaa9172f612fd1b1e04177bef270ab19
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>


More information about the vdsm-patches mailing list