Signed-off-by: Federico Morg Pareschi <[email protected]>
---
 lib/storage/bdev.py        | 13 +++++++------
 lib/storage/drbd.py        |  2 +-
 lib/storage/extstorage.py  |  8 ++++----
 lib/storage/filestorage.py |  4 ++--
 lib/storage/gluster.py     |  4 ++--
 5 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/lib/storage/bdev.py b/lib/storage/bdev.py
index b0e5c78..ad6a796 100644
--- a/lib/storage/bdev.py
+++ b/lib/storage/bdev.py
@@ -141,7 +141,7 @@ class LogicalVolume(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *args):
+             dyn_params, **kwargs):
     """Create a new logical volume.
 
     """
@@ -223,7 +223,8 @@ class LogicalVolume(base.BlockDev):
     if result.failed:
       base.ThrowError("LV create failed (%s): %s",
                       result.fail_reason, result.output)
-    return LogicalVolume(unique_id, children, size, params, dyn_params, *args)
+    return LogicalVolume(unique_id, children, size, params,
+                         dyn_params, **kwargs)
 
   @staticmethod
   def _GetVolumeInfo(lvm_cmd, fields):
@@ -772,7 +773,7 @@ class PersistentBlockDevice(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *args):
+             dyn_params, **kwargs):
     """Create a new device
 
     This is a noop, we only return a PersistentBlockDevice instance
@@ -782,7 +783,7 @@ class PersistentBlockDevice(base.BlockDev):
       raise errors.ProgrammerError("Persistent block device requested with"
                                    " exclusive_storage")
     return PersistentBlockDevice(unique_id, children, 0, params, dyn_params,
-                                 *args)
+                                 **kwargs)
 
   def Remove(self):
     """Remove a device
@@ -884,7 +885,7 @@ class RADOSBlockDevice(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *args):
+             dyn_params, **kwargs):
     """Create a new rbd device.
 
     Provision a new rbd volume inside a RADOS pool.
@@ -908,7 +909,7 @@ class RADOSBlockDevice(base.BlockDev):
                       result.fail_reason, result.output)
 
     return RADOSBlockDevice(unique_id, children, size, params, dyn_params,
-                            *args)
+                            **kwargs)
 
   def Remove(self):
     """Remove the rbd device.
diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py
index 081e96a..8f4bc54 100644
--- a/lib/storage/drbd.py
+++ b/lib/storage/drbd.py
@@ -1041,7 +1041,7 @@ class DRBD8Dev(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *_):
+             dyn_params, **kwargs):
     """Create a new DRBD8 device.
 
     Since DRBD devices are not created per se, just assembled, this
diff --git a/lib/storage/extstorage.py b/lib/storage/extstorage.py
index 32f7f45..ea750d3 100644
--- a/lib/storage/extstorage.py
+++ b/lib/storage/extstorage.py
@@ -73,14 +73,13 @@ class ExtStorageDevice(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *args):
+             dyn_params, **kwargs):
     """Create a new extstorage device.
 
     Provision a new volume using an extstorage provider, which will
     then be mapped to a block device.
 
     """
-    (name, uuid) = args
 
     if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
       raise errors.ProgrammerError("Invalid configuration data %s" %
@@ -92,10 +91,11 @@ class ExtStorageDevice(base.BlockDev):
     # Call the External Storage's create script,
     # to provision a new Volume inside the External Storage
     _ExtStorageAction(constants.ES_ACTION_CREATE, unique_id,
-                      params, size=size, name=name, uuid=uuid)
+                      params, size=size, name=kwargs["name"],
+                      uuid=kwargs["uuid"])
 
     return ExtStorageDevice(unique_id, children, size, params, dyn_params,
-                            *args)
+                            **kwargs)
 
   def Remove(self):
     """Remove the extstorage device.
diff --git a/lib/storage/filestorage.py b/lib/storage/filestorage.py
index ba89975..aac83b4 100644
--- a/lib/storage/filestorage.py
+++ b/lib/storage/filestorage.py
@@ -287,7 +287,7 @@ class FileStorage(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *args):
+             dyn_params, **kwargs):
     """Create a new file.
 
     @type size: int
@@ -307,7 +307,7 @@ class FileStorage(base.BlockDev):
 
     FileDeviceHelper.CreateFile(dev_path, size)
     return FileStorage(unique_id, children, size, params, dyn_params,
-                       *args)
+                       **kwargs)
 
 
 def GetFileStorageSpaceInfo(path):
diff --git a/lib/storage/gluster.py b/lib/storage/gluster.py
index 6aab127..f8f5dea 100644
--- a/lib/storage/gluster.py
+++ b/lib/storage/gluster.py
@@ -426,7 +426,7 @@ class GlusterStorage(base.BlockDev):
 
   @classmethod
   def Create(cls, unique_id, children, size, spindles, params, excl_stor,
-             dyn_params, *args):
+             dyn_params, **kwargs):
     """Create a new file.
 
     @param size: the size of file in MiB
@@ -456,4 +456,4 @@ class GlusterStorage(base.BlockDev):
       FileDeviceHelper.CreateFile(full_path, size, create_folders=True)
 
     return GlusterStorage(unique_id, children, size, params, dyn_params,
-                          *args)
+                          **kwargs)
-- 
2.8.0.rc3.226.g39d4020

Reply via email to