[PATCH 2/2] Call getPossiblePhysicalExtents() only once

Vratislav Podzimek vpodzime at redhat.com
Fri May 16 07:16:49 UTC 2014


On Thu, 2014-05-15 at 11:31 -0400, Anne Mulhern wrote:
> 
> 
> 
> ----- Original Message -----
> > From: "Vratislav Podzimek" <vpodzime at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Thursday, May 15, 2014 8:59:08 AM
> > Subject: [PATCH 2/2] Call getPossiblePhysicalExtents() only once
> > 
> > There's no need to call it twice and we can use a shorter name for the
> > result.
> > Also get rid of unneeded square brackets in the join() call.
> > 
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---
> >  pyanaconda/kickstart.py | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> > index e9828fb..3f69019 100644
> > --- a/pyanaconda/kickstart.py
> > +++ b/pyanaconda/kickstart.py
> > @@ -1571,10 +1571,11 @@ class
> > VolGroupData(commands.volgroup.F21_VolGroupData):
> >              self.pesize = LVM_PE_SIZE.convertTo(spec="KiB")
> >  
> >          pesize = Size("%d KiB" % self.pesize)
> > -        if pesize not in getPossiblePhysicalExtents():
> > +        possible_extents = getPossiblePhysicalExtents()
> > +        if pesize not in possible_extents:
> >              raise KickstartValueError(formatErrorMsg(self.lineno,
> >                      msg=_("Volume group given physical size of
> >                      \"%(extentSize)s\", but must be one
> >                      of:\n%(validExtentSizes)s.") %
> > -                         {"extentSize": pesize, "validExtentSizes": ",
> > ".join([str(e) for e in getPossiblePhysicalExtents()])}))
> > +                                            {"extentSize": pesize,
> > "validExtentSizes": ", ".join(str(e) for e in possible_extents)}))
> >  
> >          # If --noformat or --useexisting was given, there's really nothing
> >          to do.
> >          if not self.format or self.preexist:
> > --
> > 1.9.0
> > 
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> > 
> 
> The error message is probably worth correcting while you're there.
> 
> "physical size" should really be "physical extent size".
Good catch, I've noticed that in the GUI when testing and forgot to fix
it. Fixing locally now. Thanks!

-- 
Vratislav Podzimek

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




More information about the anaconda-patches mailing list