diff options
author | David Lehman <dlehman@redhat.com> | 2009-04-22 12:33:55 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-04-24 12:27:16 -0500 |
commit | d2ba2427d7859e4bbac27b2f3b31fc1a7690376a (patch) | |
tree | 19cf2c5961065665590b9a59e95579d2dd8a9a76 | |
parent | cb8ba145b39a23c7bf43ba4b6fba3baa6993b1f7 (diff) | |
download | anaconda-d2ba2427d7859e4bbac27b2f3b31fc1a7690376a.tar.gz anaconda-d2ba2427d7859e4bbac27b2f3b31fc1a7690376a.tar.xz anaconda-d2ba2427d7859e4bbac27b2f3b31fc1a7690376a.zip |
Protect against tracebacks from the partition isFoo properties.
This just prevents us from trying to use self.partType if it is None.
-rw-r--r-- | storage/devices.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/storage/devices.py b/storage/devices.py index 53c3d835b..c6fbdcc07 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 |