[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Fix some logic errors in storage.partitioning.shouldClear.
- From: David Lehman <dlehman redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH] Fix some logic errors in storage.partitioning.shouldClear.
- Date: Wed, 6 May 2009 12:09:57 -0500
If we're not clearing any partitions, return early. Also, be more explicit
about the CLEARPART_TYPE_LINUX case.
---
storage/partitioning.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 3046eec..afa4c76 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -253,6 +253,9 @@ def shouldClear(part, clearPartType, clearPartDisks=None, protectedPartitions=No
if not isinstance(part, PartitionDevice):
return False
+ if clearPartType == CLEARPART_TYPE_NONE:
+ return False
+
# If we got a list of disks to clear, make sure this one's on it
if clearPartDisks and part.disk.name not in clearPartDisks:
return False
@@ -265,7 +268,8 @@ def shouldClear(part, clearPartType, clearPartDisks=None, protectedPartitions=No
if part.partType not in [parted.PARTITION_NORMAL, parted.PARTITION_LOGICAL]:
return False
- if clearPartType != CLEARPART_TYPE_ALL and not part.format.linuxNative and \
+ if clearPartType == CLEARPART_TYPE_LINUX and \
+ not part.format.linuxNative and \
not part.getFlag(parted.PARTITION_LVM) and \
not part.getFlag(parted.PARTITION_RAID) and \
not part.getFlag(parted.PARTITION_SWAP):
--
1.6.0.6
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]