]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
pylibmount: cleanup and sync UL_RaiseExc
authorKarel Zak <kzak@redhat.com>
Wed, 22 Apr 2020 07:44:47 +0000 (09:44 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 22 Apr 2020 07:44:47 +0000 (09:44 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/1013
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/python/pylibmount.c

index b0b26057817ed641cf57861a778dca89724ab4c7..2e6bb62d7fb9b85a85395fe0a2fba5572bdd14a0 100644 (file)
@@ -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));