FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 08-11-2010, 05:38 PM
David Lehman
 
Default Clearing of formatting from unpartitioned disks belongs in clearPartitions.

It ended up in removeEmptyExtendedPartitions somehow, but it doesn't belong
there.
---
pyanaconda/storage/partitioning.py | 38 ++++++++++++++++++------------------
1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index af42a03..a655d0d 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -386,6 +386,25 @@ def clearPartitions(storage):
log.debug("partitions: %s" % [p.getDeviceNodeName() for p in part.partedPartition.disk.partitions])
storage.destroyDevice(part)

+ for disk in [d for d in storage.disks if d not in storage.partitioned]:
+ # clear any whole-disk formats that need clearing
+ if shouldClear(disk, storage.clearPartType, storage.clearPartDisks):
+ log.debug("clearing %s" % disk.name)
+ devices = storage.deviceDeps(disk)
+ while devices:
+ log.debug("devices to remove: %s" % ([d.name for d in devices],))
+ leaves = [d for d in devices if d.isleaf]
+ log.debug("leaves to remove: %s" % ([d.name for d in leaves],))
+ for leaf in leaves:
+ storage.destroyDevice(leaf)
+ devices.remove(leaf)
+
+ destroy_action = ActionDestroyFormat(disk)
+ newLabel = getFormat("disklabel", device=disk.path)
+ create_action = ActionCreateFormat(disk, format=newLabel)
+ storage.devicetree.registerAction(destroy_action)
+ storage.devicetree.registerAction(create_action)
+
# now remove any empty extended partitions
removeEmptyExtendedPartitions(storage)

@@ -441,25 +460,6 @@ def removeEmptyExtendedPartitions(storage):
storage.destroyDevice(extended)
#disk.partedDisk.removePartition(extended.partedPa rtition)

- for disk in [d for d in storage.disks if d not in storage.partitioned]:
- # clear any whole-disk formats that need clearing
- if shouldClear(disk, storage.clearPartType, storage.clearPartDisks):
- log.debug("clearing %s" % disk.name)
- devices = storage.deviceDeps(disk)
- while devices:
- log.debug("devices to remove: %s" % ([d.name for d in devices],))
- leaves = [d for d in devices if d.isleaf]
- log.debug("leaves to remove: %s" % ([d.name for d in leaves],))
- for leaf in leaves:
- storage.destroyDevice(leaf)
- devices.remove(leaf)
-
- destroy_action = ActionDestroyFormat(disk)
- newLabel = getFormat("disklabel", device=disk.path)
- create_action = ActionCreateFormat(disk, format=newLabel)
- storage.devicetree.registerAction(destroy_action)
- storage.devicetree.registerAction(create_action)
-
def partitionCompare(part1, part2):
""" More specifically defined partitions come first.

--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org