[master 26/30] Cache result returned by getFSInfo in _current_info attribute.
mulkieran
installerbot-noreply at redhat.com
Fri Apr 10 19:49:54 UTC 2015
From: mulhern <amulhern at redhat.com>
Related: #12
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/formats/fs.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index e318701..d691aba 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -110,6 +110,8 @@ def getTaskObject(klass):
self._sync = getTaskObject(self._syncClass)
self._writelabel = getTaskObject(self._writelabelClass)
+ self._current_info = None # info obtained by _info task
+
self.mountpoint = kwargs.get("mountpoint")
self.mountopts = kwargs.get("mountopts")
self.label = kwargs.get("label")
@@ -243,8 +245,8 @@ def updateSizeInfo(self):
errors = False
finally:
# try to gather current size info anyway
- info = self._getFSInfo()
- self._size = self._getExistingSize(info=info)
+ self._current_info = self._getFSInfo()
+ self._size = self._getExistingSize(info=self._current_info)
self._minSize = self._size # default to current size
# We absolutely need a current size to enable resize. To shrink the
# filesystem we need a real minimum size provided by the resize
@@ -253,7 +255,7 @@ def updateSizeInfo(self):
if errors or self._size == Size(0):
self._resizable = False
- self._getMinSize(info=info) # force calculation of minimum size
+ self._getMinSize(info=self._current_info) # force calculation of minimum size
def _getMinSize(self, info=None):
pass
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/9efa95c677f26d510e0ddbbd3f334f05b233816a
More information about the anaconda-patches
mailing list