From: Karel Zak Date: Wed, 22 Apr 2020 07:44:47 +0000 (+0200) Subject: pylibmount: cleanup and sync UL_RaiseExc X-Git-Tag: v2.35.2~29 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2031e0960921c9d8d7021e1016f3150ca9b80ff9;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 b7c39e502b..0d19cd9bf0 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));