[blivet:all][PATCH] Don't try to get no profile's name (#1151458)

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Oct 21 12:14:32 UTC 2014


On Tue, Oct 21, 2014 at 09:45:48AM +0200, Vratislav Podzimek wrote:
> If no profile is specified, trying to get its name results in a traceback.
> 
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  blivet/devices.py | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/blivet/devices.py b/blivet/devices.py
> index 56f8dcc..75afcc2 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -3584,10 +3584,15 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice):
>          """ Create the device. """
>          log_method_call(self, self.name, status=self.status)
>          # TODO: chunk size, data/metadata split --> profile
> +        if self.profile:

I think it might be a bit safer to do
    if hasattr(self.profile, "name"):

Otherwise ack.

> +            profile_name = self.profile.name
> +        else:
> +            profile_name = ""
> +
>          lvm.thinpoolcreate(self.vg.name, self.lvname, self.size,
>                             metadatasize=self.metaDataSize,
>                             chunksize=self.chunkSize,
> -                           profile=self.profile.name)
> +                           profile=profile_name)
>  
>      def dracutSetupArgs(self):
>          return set()
> -- 
> 1.9.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list