Python's os.minor still contains an old definition, whereas the
current one has changed. So we add our own definition working around
this bug.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
logging.warning("Storage space information requested for"
" ambiguous storage type '%s'.", storage_type)
return result
+
+
+def osminor(dev):
+ """Return the device minor number from a raw device number.
+
+ This is a replacement for os.minor working around the issue that
+ Python's os.minor still has the old definition. See Ganeti issue
+ 1058 for more details.
+ """
+ return (dev & 0xff) | ((dev >> 12) & ~0xff)