[rhel6-branch] Pass mountopts to swap options (#857517)

David Lehman dlehman at redhat.com
Sat Jun 29 00:01:11 UTC 2013


On Fri, 2013-06-28 at 14:16 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> swap is based on DeviceFormat, not FS, so mountopts weren't being
> handled. It has its own options property though, so just pass on the
> mountopts to options.

I think you could skip the 'if' wrapper since you're using kwargs.get.
It will default to None if they key isn't in the dict. Or are you doing
that because someone might have passed in options and you don't want to
clobber that? Maybe it should be

  if not self.options:

instead of

  if "mountopts" in kwargs:


Dave

> 
> Resolves: rhbz#857517
> ---
>  storage/formats/swap.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/storage/formats/swap.py b/storage/formats/swap.py
> index 824c501..de5c30a 100644
> --- a/storage/formats/swap.py
> +++ b/storage/formats/swap.py
> @@ -64,6 +64,8 @@ class SwapSpace(DeviceFormat):
>  
>          self.priority = kwargs.get("priority")
>          self.label = kwargs.get("label")
> +        if "mountopts" in kwargs:
> +            self.options = kwargs.get("mountopts")
>  
>      def __str__(self):
>          s = DeviceFormat.__str__(self)




More information about the anaconda-patches mailing list