[Yum-devel] Yum API Question

James Antill james at fedoraproject.org
Mon Jan 21 22:14:07 UTC 2013


On Mon, 2013-01-21 at 16:57 -0500, Keith Robertson wrote:
> On 01/21/2013 03:49 PM, James Antill wrote:
> > On Sun, 2013-01-20 at 12:14 -0500, Keith Robertson wrote:
> > 1. You need to loop on yb.repos.listEnabled() and set that
> > repos. .gpgcheck = False ... by the time yb.conf is setup all the repos.
> > are loaded and so changing yb.conf.gpgcheck doesn't do much (when
> > packages are downloaded they just look at pkg.repo.gpgcheck to see if
> > they should check).
> >   As a hack (which the cli uses) you could also just set
> > yb._override_sigchecks=True.
> I just found this and it works great.  Thanks.

 Cool

> > 2. If you are just downloading call downloadPkgs() instead of
> > processTransaction().
> >
> I couldn't seem to get that working.  I'm also noticing some oddball 
> errors caused by the 'atexit' handlers.  Any thoughts on these [1]?

 It wouldn't fix the problem on it's own, but it's better to call only
what you need to do.

> [1]
> Exception AttributeError: "'NoneType' object has no attribute 'sqlite'" 
> in <bound method YumBase.__del__ of <yum.YumBase object at 0x29d3d10>> 
> ignored
> Exception AttributeError: "'NoneType' object has no attribute 'sqlite'" 
> in <bound method RepoStorage.__del__ of <yum.repos.RepoStorage instance 
> at 0x2941f80>> ignored

 Weird, my _guess_ is that the yum object is being deleted as the
program exists ... and it's decided to cleanup the sqlutils module
before it cleans up the yum object (and thus. access on sqlutils.sqlite
are giving the above errors).
 I'd just do a manual yb = None, before the script ends. Or put
everything in a function.



More information about the Yum-devel mailing list