[PATCH blivet rhel7-branch] Don't pass createOptions along when creating the btrfs device.

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 31 14:11:24 UTC 2015


On Fri, 2015-07-31 at 09:23 -0400, Chris Lumens wrote:
> This only applies to the format, not the device.  Thus this needs to be
> popped off before passing the rest of the kwargs along.  This was found
> by kickstart_tests in anaconda.
> 
> Resolves: rhbz#1248313
> ---
>  blivet/__init__.py      | 1 +
>  blivet/devices/btrfs.py | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/blivet/__init__.py b/blivet/__init__.py
> index cba90cd..e61592c 100644
> --- a/blivet/__init__.py
> +++ b/blivet/__init__.py
> @@ -1238,6 +1238,7 @@ class Blivet(object):
>              fmt_args["mountopts"] = "subvol=%s" % name
>              kwargs.pop("metaDataLevel", None)
>              kwargs.pop("dataLevel", None)
> +            kwargs.pop("createOptions", None)
>          else:
>              dev_class = BTRFSVolumeDevice
>              # set up the volume label, using hostname if necessary
> diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
> index eeb203f..e72c8e4 100644
> --- a/blivet/devices/btrfs.py
> +++ b/blivet/devices/btrfs.py
> @@ -161,6 +161,7 @@ class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice):
>          # unrecognized keyword error in superclass constructor
>          dataLevel = kwargs.pop("dataLevel", None)
>          metaDataLevel = kwargs.pop("metaDataLevel", None)
> +        createOptions = kwargs.pop("createOptions", None)
>  
>          super(BTRFSVolumeDevice, self).__init__(*args, **kwargs)
>  
> @@ -181,7 +182,8 @@ class BTRFSVolumeDevice(BTRFSDevice, ContainerDevice):
>                                      label=label,
>                                      volUUID=self.uuid,
>                                      device=self.path,
> -                                    mountopts="subvolid=%d" % self.vol_id)
> +                                    mountopts="subvolid=%d" % self.vol_id,
> +                                    createOptions=createOptions)
>              self.originalFormat = copy.copy(self.format)
>  
>          self._defaultSubVolumeID = None
Looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list