adapt partition plugin to the new blockdevice interface

This commit is contained in:
lars 2008-01-30 09:58:15 +00:00
parent cbb499e7e3
commit d08dbb1957

View file

@ -172,7 +172,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
## the config partition is ignored, as it will get unmounted if necessary
for dev in blockdevice.children:
container = self.cbox.get_container(
blockdevice_tools.get_blockdevice(dev).devnodes[0])
blockdevice_tools.get_blockdevice(dev))
if container and (container.is_mounted() or container.is_busy()):
return True
return False
@ -544,8 +544,8 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
except (CBInvalidType, CBCreateError, CBVolumeIsActive), err_msg:
self.cbox.log.warn(err_msg)
return False
## remove unused volume entry
if prev_name:
## remove unused volume entry in case it exists
if prev_name and self.cbox.prefs.volumes_db.has_key(prev_name[0]):
del self.cbox.prefs.volumes_db[prev_name[0]]
return True