[master 1/1] Fix setting original size for format resize action. (#1225352)

vojtechtrefny installerbot-noreply at redhat.com
Wed Jun 3 10:45:30 UTC 2015


From: Vojtech Trefny <vtrefny at redhat.com>

Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
 blivet/deviceaction.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
index e6a0e7c..feaee2a 100644
--- a/blivet/deviceaction.py
+++ b/blivet/deviceaction.py
@@ -755,7 +755,12 @@ def __init__(self, device, newsize):
             self.dir = RESIZE_GROW
         else:
             self.dir = RESIZE_SHRINK
-        self.origSize = self.device.format.targetSize
+
+        if device.format.targetSize > Size(0):
+            self.origSize = device.format.targetSize
+        else:
+            self.origSize = device.format.currentSize
+
         self._targetSize = newsize
 
     def apply(self):


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


More information about the anaconda-patches mailing list