[rhel7-branch 1/1] PartitionDevice may not have a disk set (#1248973)

bcl installerbot-noreply at redhat.com
Fri Jul 31 22:21:58 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

When it is an implicit partition and hasn't been assigned a disk yet
self.disk may be None, so skip checking the size against the disk when
there isn't one.

Resolves: rhbz#1248973
---
 blivet/devices/partition.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 18add66..a0fd54c 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -753,7 +753,7 @@ def _setSize(self, newsize):
 
         # the rest is for changing the size of an allocated-but-not-existing
         # partition, which I'm not sure is advisable
-        if newsize > self.disk.size:
+        if self.disk and newsize > self.disk.size:
             raise ValueError("partition size would exceed disk size")
 
         maxAvailableSize = Size(self.partedPartition.getMaxAvailableSize(unit="B"))


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/20238af303265bdeb05e0fd830dee958b582f86e


More information about the anaconda-patches mailing list