[Yum-devel] [PATCH] Fix the indentation on key_installed.

James Antill james at fedoraproject.org
Tue Jun 22 21:05:23 UTC 2010


On Tue, 2010-06-22 at 16:47 -0400, seth vidal wrote:
> On Tue, 2010-06-22 at 16:20 -0400, James Antill wrote:
> > ---
> >  yum/__init__.py |   28 +++++++++++++---------------
> >  1 files changed, 13 insertions(+), 15 deletions(-)
> > 
> > diff --git a/yum/__init__.py b/yum/__init__.py
> > index 73ec7c3..bd2c60a 100644
> > --- a/yum/__init__.py
> > +++ b/yum/__init__.py
> > @@ -4286,13 +4286,13 @@ class YumBase(depsolve.Depsolve):
> >                  self.logger.info(_('Key imported successfully'))
> >                  key_installed = True
> >  
> > -                if not key_installed:
> > -                    raise Errors.YumBaseError, \
> > -                          _('The GPG keys listed for the "%s" repository are ' \
> > -                          'already installed but they are not correct for this ' \
> > -                          'package.\n' \
> > -                          'Check that the correct key URLs are configured for ' \
> > -                          'this repository.') % (repo.name)
> > +        if not key_installed:
> > +            raise Errors.YumBaseError, \
> > +                  _('The GPG keys listed for the "%s" repository are ' \
> > +                  'already installed but they are not correct for this ' \
> > +                  'package.\n' \
> > +                  'Check that the correct key URLs are configured for ' \
> > +                  'this repository.') % (repo.name)
> >  
> >          # Check if the newly installed keys helped
> >          result, errmsg = self.sigCheckPkg(po)
> > @@ -4342,14 +4342,12 @@ class YumBase(depsolve.Depsolve):
> >                  self.logger.info(_('Key imported successfully'))
> >                  key_installed = True
> >  
> > -                if not key_installed:
> > -                    raise Errors.YumBaseError, \
> > -                          _('The GPG keys listed for the "%s" repository are ' \
> > -                          'already installed but they are not correct for this ' \
> > -                          'package.\n' \
> > -                          'Check that the correct key URLs are configured for ' \
> > -                          'this repository.') % (repo.name)
> > -
> > +        if not key_installed:
> > +            raise Errors.YumBaseError, \
> > +                  _('The GPG keys listed for the "%s" repository are ' \
> > +                  'already installed but they are not correct.\n' \
> > +                  'Check that the correct key URLs are configured for ' \
> > +                  'this repository.') % (repo.name)
> >  
> >      def _limit_installonly_pkgs(self):
> >          """ Limit packages based on conf.installonly_limit, if any of the
> 
> 
> This means if the last key in the set gets installed - but the others do
> NOT then we won't get that message?

 Yeh, but that's right. Say you have:

keyfile1, keyfile2

...and both files contain 2 keys. Atm. the code does (for each key we
install):

    key_installed = True
  
    if not key_installed: 
        raise no_keys_installed_msg

...with the indentation fixed, we get the var. set to True if any key is
installed (and we then check it, and if it fails raise a different
msg) ... and if no keys are installed we get the "no keys installed"
msg.

> Do you mean to change this more? Ie: to say 'all installed, some
> installed' sort of error message?

 We might want to do something like that if we "fix" 606644, but atm.
all the keys will be installed at the end of the run ... the only
difference is if any weren't installed before (and thus. if it's worth
checking the signature again).



More information about the Yum-devel mailing list