Nir Soffer has uploaded a new change for review.

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
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/21211/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 5207d84..537c73f 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -2030,7 +2030,9 @@
             try:
                 res = (os.stat('/dev/mapper/' + guid).st_mode &
                        stat.S_IRUSR != 0)
-            except:
+            except OSerror as e:
+                if e.errno != errno.NOENT:
+                    raise
                 res = False
             return res
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7411d7d2eaa9172f612fd1b1e04177bef270ab19
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to