[Yum-devel] [PATCH] gpgkey improvements

seth vidal skvidal at phy.duke.edu
Sun Jan 16 09:52:07 UTC 2005


On Sun, 2005-01-16 at 12:49 +1000, Menno Smits wrote:
> Hi all,
> 
> The attached patch improves and simplifies the behaviour of the new 
> gpgkey option (GPG key importing).
> 

Looks great.

I added one thing.
if the gpgkey specified in the config is garbage it would exit with a
traceback. Specifically:
Traceback (most recent call last):
  File "./yummain.py", line 173, in ?
    main(sys.argv[1:])
  File "./yummain.py", line 146, in main
    base.doTransaction()
  File "/home/skvidal/cvs/yum-HEAD/cli.py", line 636, in doTransaction
    if self.gpgsigcheck(downloadpkgs) != 0:
  File "/home/skvidal/cvs/yum-HEAD/cli.py", line 730, in gpgsigcheck
    keyinfo = yum.misc.getgpgkeyinfo(rawkey)
  File "/home/skvidal/cvs/yum-HEAD/yum/misc.py", line 192, in
getgpgkeyinfo
    info = {
AttributeError: 'NoneType' object has no attribute 'user_id'


I added a check in yum.misc.getgpgkeyinfo():

if key is None:
    raise ValueError('No key found in given key data')

If you'd rather it not be that way, or if there is a better place to
catch that, let me know. It seemed reasonable to me when I was looking
through the code.

Thanks, this is great.
-sv





More information about the Yum-devel mailing list