[blivet:master 06/15] Make doFormat use regular style keyword parameters

mulhern amulhern at redhat.com
Wed May 7 23:05:50 UTC 2014


doFormat is almost a leaf procedure and it is unlikely to find itself
calling procedures that require arbitrary arguments.

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

diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 68e50a3..29886dd 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -357,18 +357,16 @@ class FS(DeviceFormat):
         argv.append(self.device)
         return argv
 
-    def doFormat(self, *args, **kwargs):
+    def doFormat(self, options=None):
         """ Create the filesystem.
 
-            :keyword options: options to pass to mkfs
+            :param options: options to pass to mkfs
             :type options: list of strings
             :raises: FormatCreateError, FSError
         """
         log_method_call(self, type=self.mountType, device=self.device,
                         mountpoint=self.mountpoint)
 
-        options = kwargs.get("options")
-
         if self.exists:
             raise FormatCreateError("filesystem already exists", self.device)
 
@@ -815,7 +813,7 @@ class FS(DeviceFormat):
 
         DeviceFormat.create(self, *args, **kwargs)
 
-        return self.doFormat(*args, **kwargs)
+        return self.doFormat(options=kwargs.get('options'))
 
     def setup(self, *args, **kwargs):
         """ Mount the filesystem.
-- 
1.8.3.1



More information about the anaconda-patches mailing list