[blivet:master 15/21] Make _getExistingSize() method more generally useful.

mulhern amulhern at redhat.com
Thu Jan 15 18:39:42 UTC 2015


If it gathers data only if self._size is not 0, then it is necessary
to set self._size to 0 to get it to run, which can prove awkward.

This doesn't change any observable behavior, since self._getExistingSize()
is always called when self._size is 0 anyway.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/formats/fs.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index a83e093..bd0f081 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -305,11 +305,11 @@ class FS(DeviceFormat):
             :returns: size of existing fs in MiB.
             :rtype: float.
         """
-        size = self._size
+        if not self._existingSizeFields:
+            return Size(0)
 
-        if self.exists and not size:
-            if not self._existingSizeFields:
-                return Size(0)
+        size = Size(0)
+        if self.exists:
             if info is None:
                 info = self._getFSInfo()
 
-- 
1.9.3



More information about the anaconda-patches mailing list