From: Karel Zak Date: Wed, 22 Apr 2020 07:44:47 +0000 (+0200) Subject: pylibmount: cleanup and sync UL_RaiseExc X-Git-Tag: v2.36-rc1~139 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2aedec8d1aa4fd9b50e0248b6dc86d2a8776fd8;p=thirdparty%2Futil-linux.git pylibmount: cleanup and sync UL_RaiseExc Addresses: https://github.com/karelzak/util-linux/issues/1013 Signed-off-by: Karel Zak --- diff --git a/libmount/python/pylibmount.c b/libmount/python/pylibmount.c index b0b2605781..2e6bb62d7f 100644 --- a/libmount/python/pylibmount.c +++ b/libmount/python/pylibmount.c @@ -51,24 +51,36 @@ void *UL_RaiseExc(int e) PyErr_SetString(PyExc_TypeError, strerror(e)); break; /* libmount-specific errors */ - case MNT_ERR_APPLYFLAGS: - PyErr_SetString(LibmountError, "Failed to apply MS_PROPAGATION flags"); - break; - case MNT_ERR_MOUNTOPT: - PyErr_SetString(LibmountError, "Failed to parse/use userspace mount options"); - break; case MNT_ERR_NOFSTAB: - PyErr_SetString(LibmountError, "Failed to detect filesystem type"); + PyErr_SetString(LibmountError, "Not found required entry in fstab"); break; case MNT_ERR_NOFSTYPE: - PyErr_SetString(LibmountError, "Required mount source undefined"); + PyErr_SetString(LibmountError, "Lailed to detect filesystem type"); break; case MNT_ERR_NOSOURCE: + PyErr_SetString(LibmountError, "Required mount source undefined"); + break; + case MNT_ERR_LOOPDEV: PyErr_SetString(LibmountError, "Loopdev setup failed"); break; + case MNT_ERR_APPLYFLAGS: + PyErr_SetString(LibmountError, "Failed to parse/use userspace mount options"); + break; + case MNT_ERR_MOUNTOPT: + PyErr_SetString(LibmountError, "Failed to apply propagation flags"); + break; case MNT_ERR_AMBIFS: PyErr_SetString(LibmountError, "Libblkid detected more filesystems on the device"); break; + case MNT_ERR_LOOPOVERLAP: + PyErr_SetString(LibmountError, "Detected overlapping loop device that cannot be re-use"); + break; + case MNT_ERR_LOCK: + PyErr_SetString(LibmountError, "Failed to lock mtab/utab or so"); + break; + case MNT_ERR_NAMESPACE: + PyErr_SetString(LibmountError, "Failed to switch namespace"); + break; /* some other errno */ default: PyErr_SetString(PyExc_Exception, strerror(e));