[Yum-devel] Yum API Question

Keith Robertson kroberts at redhat.com
Mon Jan 21 22:21:00 UTC 2013


On 01/21/2013 05:14 PM, James Antill wrote:
> 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.

yb = None did the trick.  Thanks!

For reference, here is how I noticed that 'atexit' exception:
- First, that exception doesn't occur when you run the script at the top 
of this thread.
- When I include/use YumBase in Python's cmd.Cmd I notice this 
exception.  Not sure why but I'm guessing it has to do with the way 
cmd.Cmd exits.

>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel



More information about the Yum-devel mailing list