[anaconda][rhel7-branch/master][PATCH] Show environment specified in kickstart as selected in the GUI (#1087831)

Vratislav Podzimek vpodzime at redhat.com
Tue Sep 30 11:25:43 UTC 2014


On Mon, 2014-09-29 at 14:02 +0200, Martin Kolman wrote:
> On Fri, 2014-09-26 at 14:18 -0400, Anne Mulhern wrote:
> > 
> > 
> > 
> > ----- Original Message -----
> > > From: "Martin Kolman" <mkolman at redhat.com>
> > > To: anaconda-patches at lists.fedorahosted.org
> > > Sent: Friday, September 26, 2014 1:18:31 PM
> > > Subject: [anaconda][rhel7-branch/master][PATCH] Show environment specified in	kickstart as selected in the GUI
> > > (#1087831)
> > > 
> > > Previously the environment name from kickstart was not properly normalized,
> > > so it did not match on available environments and was not selected in
> > > the software spoke.
> > > 
> > > Also fix the spoke status not showing the environment name until the software
> > > spoke
> > > is first entered.
> > > 
> > > Resolves: rhbz#1087831
> > > Signed-off-by: Martin Kolman <mkolman at redhat.com>
> > > ---
> > >  pyanaconda/ui/gui/spokes/software.py | 29 +++++++++++++++++++++++++----
> > >  1 file changed, 25 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/pyanaconda/ui/gui/spokes/software.py
> > > b/pyanaconda/ui/gui/spokes/software.py
> > > index b37114c..e8e1a31 100644
> > > --- a/pyanaconda/ui/gui/spokes/software.py
> > > +++ b/pyanaconda/ui/gui/spokes/software.py
> > > @@ -23,7 +23,7 @@ from gi.repository import Gdk
> > >  
> > >  from pyanaconda.flags import flags
> > >  from pyanaconda.i18n import _, N_
> > > -from pyanaconda.packaging import PackagePayload, payloadMgr
> > > +from pyanaconda.packaging import PackagePayload, payloadMgr, NoSuchGroup
> > >  from pyanaconda.threads import threadMgr, AnacondaThread
> > >  from pyanaconda import constants, iutil
> > >  
> > > @@ -201,7 +201,17 @@ class SoftwareSelectionSpoke(NormalSpoke):
> > >              # they did an install without a desktop environment.  This
> > >              should
> > >              # catch that one case.
> > >              if flags.automatedInstall and self.data.packages.seen:
> > > -                return _("Custom software selected")
> > > +                # the environment store that is normally used to obtain the
> > > currently
> > > +                # selected environment name is not loaded before the
> > > software spoke
> > > +                # is first entered, so we show the name directly in such
> > > case
> > > +                early_environment = _("Custom software selected")
> > > +                if self.environment is not None:
> > > +                    try:
> > > +                        early_environment =
> > > self.payload.environmentDescription(self.environment)[0]
> > > +                    except NoSuchGroup:
> > > +                        # the currently set environment is unknown to our
> > > packaging backend
> > > +                        early_environment = _("Unknown custom software
> > > selected")
> > > +                return early_environment
> > >  
> > >              return _("Nothing selected")
> > >  
> > > @@ -241,8 +251,19 @@ class SoftwareSelectionSpoke(NormalSpoke):
> > >          threadMgr.wait(constants.THREAD_PAYLOAD)
> > >  
> > >          self._environmentStore.clear()
> > > -        if self.environment not in self.payload.environments:
> > > +        # check if currently set environment is compatible with the
> > > currently available environments
> > > +        normalized_environments =
> > > [self.payload.environmentDescription(env)[0] for env in
> > > self.payload.environments]
> > > +
> > > +        # the environment might be totally unknown to our packaging backend
> > > +        try:
> > > +            current_normalized_environment =
> > > self.payload.environmentDescription(self.environment)[0]
> > > +        except NoSuchGroup:
> > > +            current_normalized_environment = None
> > > +
> > 
> > Please move the definition of normalized_environments down here, next to its use.
> Fixing locally.
ACK with this change applied.

-- 
Vratislav Podzimek

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




More information about the anaconda-patches mailing list