Re: [PATCH 5/8] Make sure _getResizeArgs() return lists of strings, add one for NTFS.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/05/2009 10:29 AM, David Cantrell wrote:
On 03/05/2009 10:11 AM, Chris Lumens wrote:
The _getResizeArgs() methods need to return lists of strings since
we pass that to the exec functions. Add a _getResizeArgs() to the
NTFS class.

Does it make more sense or make for cleaner code if resizeArgs is a
property? It seems like we're using those a lot in the new storage
code.

Aside from that, this whole series of patches looks fine.

Yeah, that's doable. I'll change it up.


New patch attached.

--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI
>From 4838acbd3f5b8de30d1a8c12b0b1d188aa27a5a4 Mon Sep 17 00:00:00 2001
From: David Cantrell <dcantrell@xxxxxxxxxx>
Date: Thu, 5 Mar 2009 10:35:02 -1000
Subject: [PATCH 8/8] Add resizeArgs property for resizable filesystems.

---
 storage/formats/fs.py |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index 9c61b59..d27b348 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -300,8 +300,9 @@ class FS(DeviceFormat):
         # instance of the new filesystem type.
         self._type = self.migrationTarget
 
-    def _getResizeArgs(self):
-        argv = [self.device, self.targetSize]
+    @property
+    def resizeArgs(self):
+        argv = [self.device, "%d" % (self.targetSize,)]
         return argv
 
     def doResize(self, *args, **kwargs):
@@ -336,8 +337,6 @@ class FS(DeviceFormat):
 
         self.doCheck(intf=intf)
 
-        argv = self._getResizeArgs()
-
         w = None
         if intf:
             w = intf.progressWindow(_("Resizing"),
@@ -347,7 +346,7 @@ class FS(DeviceFormat):
 
         try:
             rc = iutil.execWithPulseProgress(self.resizefsProg,
-                                             argv,
+                                             self.resizeArgs,
                                              stdout="/dev/tty5",
                                              stderr="/dev/tty5",
                                              progress=w)
@@ -800,8 +799,9 @@ class BTRFS(FS):
         argv.append(self.device)
         return argv
 
-    def _getResizeArgs(self):
-        argv = ["-r", self.targetSize, self.device]
+    @property
+    def resizeArgs(self):
+        argv = ["-r", "%d" % (self.targetSize,), self.device]
         return argv
 
     @property
@@ -941,6 +941,14 @@ class NTFS(FS):
 
         return size
 
+    @property
+    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", "%dM" % (self.targetSize,), self.device]
+        return argv
+
+
 register_device_format(NTFS)
 
 
-- 
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux