From 23bb313594ba599676e21378cfbf2f51147c2dfb Mon Sep 17 00:00:00 2001 From: lars Date: Tue, 14 Nov 2006 12:32:08 +0000 Subject: [PATCH] fixed a nasty typo adapted to new volume name management --- plugins/partition/partition.py | 12 ++++++------ plugins/partition/set_partitions.cs | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/partition/partition.py b/plugins/partition/partition.py index 4a10189..c6acf8c 100644 --- a/plugins/partition/partition.py +++ b/plugins/partition/partition.py @@ -41,7 +41,7 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin): pass ## no (or invalid) device was supplied if not self.device: - step == "select_device" + step = "select_device" if step == "add_partition": return self.__actionAddPartition(args) elif step == "del_partition": @@ -230,7 +230,6 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin): self.hdf[self.hdf_prefix + "Types.%s" % t] = t ## store the currently existing partitions of the choosen block device current_containers = [ e for e in self.cbox.getContainerList() if CryptoBoxTools.isPartOfBlockDevice(self.device, e.getDevice()) ] - ## additionally store the uuids (to be removed after partitioning) for (index, t) in enumerate(current_containers): self.hdf[self.hdf_prefix + "ExistingContainers.%d.name" % index] = t.getName() self.hdf[self.hdf_prefix + "ExistingContainers.%d.size" % index] = CryptoBoxTools.getBlockDeviceSizeHumanly(t.getDevice()) @@ -373,7 +372,8 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin): def __formatOnePartition(self, dev_name, type): ## first: retrieve UUID - it can be removed from the database afterwards - prev_uuid = [self.cbox.getUUIDForName(e.getName()) for e in self.cbox.getContainerList() if e.getDevice() == dev_name ] + volDB = self.cbox.prefs.volumesDB + prev_name = [e.getName() for e in self.cbox.getContainerList() if e.getDevice() == dev_name] ## call "mkfs" proc = subprocess.Popen( shell = False, @@ -390,9 +390,9 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin): self.cbox.log.warn("failed to create filesystem on %s: %s" % (dev_name, error)) return False else: - ## remove unused uuid - if prev_uuid: - self.cbox.removeUUID(prev_uuid[0]) + ## remove unused volume entry + if prev_name: + self.cbox.prefs.volumesDB[prev_name[0]] return True diff --git a/plugins/partition/set_partitions.cs b/plugins/partition/set_partitions.cs index 3d30e6d..5d52c61 100644 --- a/plugins/partition/set_partitions.cs +++ b/plugins/partition/set_partitions.cs @@ -2,19 +2,19 @@ + + 0) || (subcount(Data.Plugins.partition.Parts) > 0) ?> +

- 0) || (subcount(Data.Plugins.partition.Parts) > 0) ?> - - @@ -74,3 +74,5 @@

+ +