[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Protect against tracebacks from the partition isFoo properties.
- From: David Lehman <dlehman redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH] Protect against tracebacks from the partition isFoo properties.
- Date: Thu, 23 Apr 2009 17:35:48 -0500
This just prevents us from trying to use self.partType if it is None.
---
storage/devices.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/storage/devices.py b/storage/devices.py
index 53c3d83..c6fbdcc 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -997,19 +997,23 @@ class PartitionDevice(StorageDevice):
@property
def isExtended(self):
- return self.partType & parted.PARTITION_EXTENDED
+ return (self.partType is not None and
+ self.partType & parted.PARTITION_EXTENDED)
@property
def isLogical(self):
- return self.partType & parted.PARTITION_LOGICAL
+ return (self.partType is not None and
+ self.partType & parted.PARTITION_LOGICAL)
@property
def isPrimary(self):
- return self.partType == parted.PARTITION_NORMAL
+ return (self.partType is not None and
+ self.partType == parted.PARTITION_NORMAL)
@property
def isProtected(self):
- return self.partType & parted.PARTITION_PROTECTED
+ return (self.partType is not None and
+ self.partType & parted.PARTITION_PROTECTED)
def _getPartedPartition(self):
return self._partedPartition
--
1.6.0.6
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]