LGTM, thanks.

On Mon, Feb 3, 2014 at 5:12 PM, Klaus Aehlig <[email protected]> wrote:

> In commit 702c3270 two new parameters were added to the
> Create function of BlockDev. Make subclasses also adhere
> this specification.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  lib/storage/bdev.py        | 19 +++++++++++--------
>  lib/storage/drbd.py        |  2 +-
>  lib/storage/filestorage.py |  5 +++--
>  lib/storage/gluster.py     |  5 +++--
>  4 files changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/lib/storage/bdev.py b/lib/storage/bdev.py
> index 3c6db32..02dcf8f 100644
> --- a/lib/storage/bdev.py
> +++ b/lib/storage/bdev.py
> @@ -127,7 +127,7 @@ class LogicalVolume(base.BlockDev):
>
>    @classmethod
>    def Create(cls, unique_id, children, size, spindles, params, excl_stor,
> -             dyn_params):
> +             dyn_params, *args):
>      """Create a new logical volume.
>
>      """
> @@ -209,7 +209,7 @@ 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)
> +    return LogicalVolume(unique_id, children, size, params, dyn_params,
> *args)
>
>    @staticmethod
>    def _GetVolumeInfo(lvm_cmd, fields):
> @@ -751,7 +751,7 @@ class PersistentBlockDevice(base.BlockDev):
>
>    @classmethod
>    def Create(cls, unique_id, children, size, spindles, params, excl_stor,
> -             dyn_params):
> +             dyn_params, *args):
>      """Create a new device
>
>      This is a noop, we only return a PersistentBlockDevice instance
> @@ -760,7 +760,8 @@ class PersistentBlockDevice(base.BlockDev):
>      if excl_stor:
>        raise errors.ProgrammerError("Persistent block device requested
> with"
>                                     " exclusive_storage")
> -    return PersistentBlockDevice(unique_id, children, 0, params,
> dyn_params)
> +    return PersistentBlockDevice(unique_id, children, 0, params,
> dyn_params,
> +                                 *args)
>
>    def Remove(self):
>      """Remove a device
> @@ -854,7 +855,7 @@ class RADOSBlockDevice(base.BlockDev):
>
>    @classmethod
>    def Create(cls, unique_id, children, size, spindles, params, excl_stor,
> -             dyn_params):
> +             dyn_params, *args):
>      """Create a new rbd device.
>
>      Provision a new rbd volume inside a RADOS pool.
> @@ -877,7 +878,8 @@ class RADOSBlockDevice(base.BlockDev):
>        base.ThrowError("rbd creation failed (%s): %s",
>                        result.fail_reason, result.output)
>
> -    return RADOSBlockDevice(unique_id, children, size, params, dyn_params)
> +    return RADOSBlockDevice(unique_id, children, size, params, dyn_params,
> +                            *args)
>
>    def Remove(self):
>      """Remove the rbd device.
> @@ -1210,7 +1212,7 @@ class ExtStorageDevice(base.BlockDev):
>
>      """
>      super(ExtStorageDevice, self).__init__(unique_id, children, size,
> params,
> -                                           dyn_params)
> +                                           dyn_params, *args)
>      (self.name, self.uuid) = args
>
>      if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
> @@ -1245,7 +1247,8 @@ class ExtStorageDevice(base.BlockDev):
>      _ExtStorageAction(constants.ES_ACTION_CREATE, unique_id,
>                        params, size=str(size), name=name, uuid=uuid)
>
> -    return ExtStorageDevice(unique_id, children, size, params, dyn_params)
> +    return ExtStorageDevice(unique_id, children, size, params, dyn_params,
> +                            *args)
>
>    def Remove(self):
>      """Remove the extstorage device.
> diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py
> index 73542c2..1d92b4b 100644
> --- a/lib/storage/drbd.py
> +++ b/lib/storage/drbd.py
> @@ -1027,7 +1027,7 @@ class DRBD8Dev(base.BlockDev):
>
>    @classmethod
>    def Create(cls, unique_id, children, size, spindles, params, excl_stor,
> -             dyn_params):
> +             dyn_params, *_):
>      """Create a new DRBD8 device.
>
>      Since DRBD devices are not created per se, just assembled, this
> diff --git a/lib/storage/filestorage.py b/lib/storage/filestorage.py
> index 405190a..640c896 100644
> --- a/lib/storage/filestorage.py
> +++ b/lib/storage/filestorage.py
> @@ -265,7 +265,7 @@ class FileStorage(base.BlockDev):
>
>    @classmethod
>    def Create(cls, unique_id, children, size, spindles, params, excl_stor,
> -             dyn_params):
> +             dyn_params, *args):
>      """Create a new file.
>
>      @type size: int
> @@ -284,7 +284,8 @@ class FileStorage(base.BlockDev):
>      dev_path = unique_id[1]
>
>      FileDeviceHelper.CreateFile(dev_path, size)
> -    return FileStorage(unique_id, children, size, params, dyn_params)
> +    return FileStorage(unique_id, children, size, params, dyn_params,
> +                       *args)
>
>
>  def GetFileStorageSpaceInfo(path):
> diff --git a/lib/storage/gluster.py b/lib/storage/gluster.py
> index 8a782aa..5fabb42 100644
> --- a/lib/storage/gluster.py
> +++ b/lib/storage/gluster.py
> @@ -417,7 +417,7 @@ class GlusterStorage(base.BlockDev):
>
>    @classmethod
>    def Create(cls, unique_id, children, size, spindles, params, excl_stor,
> -             dyn_params):
> +             dyn_params, *args):
>      """Create a new file.
>
>      @param size: the size of file in MiB
> @@ -446,4 +446,5 @@ class GlusterStorage(base.BlockDev):
>      with volume_obj.Mount():
>        FileDeviceHelper.CreateFile(full_path, size, create_folders=True)
>
> -    return GlusterStorage(unique_id, children, size, params, dyn_params)
> +    return GlusterStorage(unique_id, children, size, params, dyn_params,
> +                          *args)
> --
> 1.9.0.rc1.175.g0b1dcb5
>
>

Reply via email to