skip unreadable blockdevices (e.g. partitionable devices)

This commit is contained in:
lars 2008-01-28 21:41:55 +00:00
parent 61ad765be6
commit cbb499e7e3

View file

@ -573,6 +573,10 @@ class Blockdevice:
LOGGER.warning("Failed to call '%s' to determine UUID: %s" % \
(prefs["Programs"]["blkid"], err_msg))
return None
if proc.returncode == 2:
## the device does not contain a filesystem (e.g. it is zeroed or
## it contains a partition table)
return None
if proc.returncode != 0:
LOGGER.warning("Execution of '%s' for '%s' failed: %s" % \
(prefs["Programs"]["blkid"], self.devnodes[0],
@ -612,6 +616,10 @@ class Blockdevice:
% prefs["Programs"]["blkid"] + "'%s': %s" % \
(self.devnodes[0], err_msg))
return None
if proc.returncode == 2:
## the device does not contain a filesystem (e.g. it is zeroed or
## it contains a partition table)
return None
if proc.returncode != 0:
LOGGER.warning("Execution of '%s' for '%s' failed: %s" % \
(prefs["Programs"]["blkid"], self.devnodes[0],
@ -652,6 +660,10 @@ class Blockdevice:
% prefs["Programs"]["blkid"] + " '%s': %s" % \
(self.devnodes[0], err_msg))
return None
if proc.returncode == 2:
## the device does not contain a filesystem (e.g. it is zeroed or
## it contains a partition table)
return None
if proc.returncode != 0:
LOGGER.warning("Execution of '%s' for '%s' failed: %s" % \
(prefs["Programs"]["blkid"], self.devnodes[0],