Saggi Mizrahi has posted comments on this change.

Change subject: fix error handling in isdir and islink
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

http://gerrit.ovirt.org/#/c/29633/1/vdsm/storage/outOfProcess.py
File vdsm/storage/outOfProcess.py:

Line 253:             except OSError as e:
Line 254:                 if e.errno == errno.ENOENT:
Line 255:                     return False
Line 256:                 else:
Line 257:                     raise e
use and empty raise so you don't mix up the stack trace

"...raise with no expressions should be preferred if the exception to be 
re-raised was the most recently active exception in the current scope." [1]

[1] https://docs.python.org/2.7/reference/simple_stmts.html#the-raise-statement
Line 258:             else:
Line 259:                 return stat.S_ISDIR(res.st_mode)
Line 260: 
Line 261:         def islink(self, path):


Line 264:             except OSError as e:
Line 265:                 if e.errno == errno.ENOENT:
Line 266:                     return False
Line 267:                 else:
Line 268:                     raise e
Again
Line 269:             else:
Line 270:                 return stat.S_ISLNK(res.st_mode)
Line 271: 
Line 272:         def lexists(self, path):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaa7d1a16ba2940963d29a19a7140235fbd80ba8d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to