[blivet:master 1/4] Make _minInstanceSize, a source of minSize() value, always a Size.

mulhern amulhern at redhat.com
Tue Nov 4 16:46:10 UTC 2014


This will make minSize be a Size more often and None less often, probably
never.

Remove class level variable _minInstanceSize in TmpFS. _minInstanceSize is
always set to Size(0) in FS.__init__(), and is supposed to be an instance
variable.

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

diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index d237b33..3205a57 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -112,7 +112,7 @@ class FS(DeviceFormat):
 
         # filesystem size does not necessarily equal device size
         self._size = kwargs.get("size", Size(0))
-        self._minInstanceSize = None    # min size of this FS instance
+        self._minInstanceSize = Size(0)    # min size of this FS instance
         self._mountpoint = None     # the current mountpoint when mounted
 
         if flags.installer_mode:
@@ -439,7 +439,7 @@ class FS(DeviceFormat):
         # properly unmounted. After doCheck the minimum size will be correct
         # so run the check one last time and bump up the size if it was too
         # small.
-        self._minInstanceSize = None
+        self._minInstanceSize = Size(0)
         if self.targetSize < self.minSize:
             self.targetSize = self.minSize
             log.info("Minimum size changed, setting targetSize on %s to %s",
@@ -1504,8 +1504,6 @@ class TmpFS(NoDevFS):
     # as tmpfs is part of the Linux kernel,
     # it is Linux-native
     _linuxNative = True
-    # empty tmpfs has zero overhead
-    _minInstanceSize = 0
     # tmpfs really does not occupy any space by itself
     _minSize = 0
     # in a sense, I guess tmpfs is formattable
-- 
1.9.3



More information about the anaconda-patches mailing list