From 8e6415428876d4dd1046f66e430d865ca0482ae0 Mon Sep 17 00:00:00 2001 From: David Lehman Date: Wed, 8 Aug 2012 09:58:51 -0500 Subject: [PATCH 17/21] Remove shrink code that was a workaround for the old ui flow. --- pyanaconda/storage/__init__.py | 1 - pyanaconda/storage/partitioning.py | 16 ---------------- 2 files changed, 0 insertions(+), 17 deletions(-) diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index ee4e20c..881dc0c 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -354,7 +354,6 @@ class Storage(object): self.autoPartAddBackupPassphrase = False self.encryptionRetrofit = False self.autoPartitionRequests = [] - self.shrinkPartitions = {} self.eddDict = {} self.__luksDevs = {} diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py index a900418..7f34b85 100644 --- a/pyanaconda/storage/partitioning.py +++ b/pyanaconda/storage/partitioning.py @@ -265,19 +265,6 @@ def _scheduleVolumes(storage, devs): # schedule the device for creation storage.createDevice(dev) -def scheduleShrinkActions(storage): - """ Schedule actions to shrink partitions as per autopart selection. """ - for (path, size) in storage.shrinkPartitions.items(): - device = storage.devicetree.getDeviceByPath(path, preferLeaves=False) - if not device or not isinstance(device, PartitionDevice): - raise StorageError("device %s scheduled for shrink disappeared" - % path) - storage.devicetree.registerAction(ActionResizeFormat(device, size)) - storage.devicetree.registerAction(ActionResizeDevice(device, size)) - # aligning the partition's new end sector may have changed the size - if device.targetSize != size: - device.format.targetSize = device.targetSize - def doAutoPartition(storage, data): log.debug("doAutoPart: %s" % storage.doAutoPart) log.debug("encryptedAutoPart: %s" % storage.encryptedAutoPart) @@ -294,9 +281,6 @@ def doAutoPartition(storage, data): devs = [] if storage.doAutoPart: - # XXX this doesn't belong on newui - scheduleShrinkActions(storage) - disks = _getCandidateDisks(storage) devs = _scheduleImplicitPartitions(storage, disks) log.debug("candidate disks: %s" % disks) -- 1.7.7.6