[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 3/4] Fix test for unsupported format type in kickstart.



On Mon, 2012-02-27 at 16:56 -0800, Brian C. Lane wrote:
> On Mon, Feb 27, 2012 at 04:37:16PM -0600, David Lehman wrote:
> > ---
> >  pyanaconda/kickstart.py |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> > index aede8da..23c624a 100644
> > --- a/pyanaconda/kickstart.py
> > +++ b/pyanaconda/kickstart.py
> > @@ -559,7 +559,7 @@ class LogVolData(commands.logvol.F15_LogVolData):
> >                             label=self.label,
> >                             fsprofile=self.fsprofile,
> >                             mountopts=self.fsopts)
> > -        if not format:
> > +        if not format.type:
> >              raise KickstartValueError, formatErrorMsg(self.lineno, msg="The \"%s\" filesystem type is not supported." % type)
> >  
> >          # If we were given a pre-existing LV to create a filesystem on, we need
> > @@ -878,7 +878,7 @@ class PartitionData(commands.partition.F12_PartData):
> >                                       label=self.label,
> >                                       fsprofile=self.fsprofile,
> >                                       mountopts=self.fsopts)
> > -        if not kwargs["format"]:
> > +        if not kwargs["format"].type:
> >              raise KickstartValueError, formatErrorMsg(self.lineno, msg="The \"%s\" filesystem type is not supported." % type)
> >  
> >          # If we were given a specific disk to create the partition on, verify
> > @@ -1051,7 +1051,7 @@ class RaidData(commands.raid.F15_RaidData):
> >                                       fsprofile=self.fsprofile,
> >                                       mountpoint=self.mountpoint,
> >                                       mountopts=self.fsopts)
> > -        if not kwargs["format"]:
> > +        if not kwargs["format"].type:
> >              raise KickstartValueError, formatErrorMsg(self.lineno, msg="The \"%s\" filesystem type is not supported." % type)
> >  
> >          kwargs["name"] = devicename
> > -- 
> > 1.7.7.6
> 
> I think all of these should test if not format or not format.type since
> getFormat() can return None.

It actually cannot return None. That comment is wrong. If you look at
get_device_format_class, it will return DeviceFormat if it couldn't do
any better.

> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list redhat com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]