Vered Volansky has uploaded a new change for review. Change subject: vdsm: Throw MountError in mount.getRecord()(#883877) ......................................................................
vdsm: Throw MountError in mount.getRecord()(#883877) getRecord() in mount.py threw OSError, while _translateConnectionError in hsm.py expectes MountError. getRecord now throws MountError. Other calling methods expecting OSError are now expecting MountError, according to the fix. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=883877 Change-Id: I0f36b3ea18690d7cf53439e5a0342b1495f4f181 Signed-off-by: Vered Volansky <[email protected]> --- M vdsm/storage/mount.py M vdsm/storage/storageServer.py 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/10966/1 diff --git a/vdsm/storage/mount.py b/vdsm/storage/mount.py index 81ca17f..df3ea7b 100644 --- a/vdsm/storage/mount.py +++ b/vdsm/storage/mount.py @@ -252,7 +252,7 @@ def isMounted(self): try: self.getRecord() - except OSError: + except MountError: return False return True @@ -263,9 +263,9 @@ record.fs_file == self.fs_file): return record - raise OSError(errno.ENOENT, - "Mount of `%s` at `%s` does not exist" % - (self.fs_spec, self.fs_file)) + raise MountError(errno.ENOENT, + "Mount of `%s` at `%s` does not exist" % + (self.fs_spec, self.fs_file)) def __repr__(self): return ("<Mount fs_spec='%s' fs_file='%s'>" % diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py index b9c0847..b653a71 100644 --- a/vdsm/storage/storageServer.py +++ b/vdsm/storage/storageServer.py @@ -268,7 +268,7 @@ return 4 else: return 3 - except OSError: + except MountError: # We are not connected pass -- To view, visit http://gerrit.ovirt.org/10966 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f36b3ea18690d7cf53439e5a0342b1495f4f181 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vered Volansky <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
