[blivet:master 17/20] Use _resizefsUnit in resizeArgs() method implementations.

mulhern amulhern at redhat.com
Tue Dec 23 23:42:30 UTC 2014


The reason it is used elsewhere, i.e., when calculating minimum size
is because of the constraint on the resizeArgs() method to use the
units defined by _resizefsUnit. This patch makes that explicit.

This patch doesn't change behavior, it replaces a literal with an
already defined constant of the same value in appropriate places.

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

diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 10c83ca..6de4f6f 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -1047,7 +1047,7 @@ class Ext2FS(FS):
 
     @property
     def resizeArgs(self):
-        argv = ["-p", self.device, "%dM" % (self.targetSize.convertTo(MiB))]
+        argv = ["-p", self.device, "%dM" % (self.targetSize.convertTo(self._resizefsUnit))]
         return argv
 
 register_device_format(Ext2FS)
@@ -1446,7 +1446,7 @@ class NTFS(FS):
     def resizeArgs(self):
         # You must supply at least two '-f' options to ntfsresize or
         # the proceed question will be presented to you.
-        argv = ["-ff", "-s", "%d" % self.targetSize.convertTo(B),
+        argv = ["-ff", "-s", "%d" % self.targetSize.convertTo(self._resizefsUnit),
                 self.device]
         return argv
 
-- 
1.9.3



More information about the anaconda-patches mailing list