[Yum-devel] API question: reset all repos

2012-01-10 Thread Jack Neely
Folks, I'm working on a Yum driver for Bcfg2, a configuration management tool. I would like to be able to "reset" the repos that Yum knowns about so that it will re-read and parse all of its .repo files. What's the best way to do this? Here's the code flow I'm working with: 1. Load up the Yum d

Re: [Yum-devel] [PATCH 2/3] Add argument 'errorfunc' to _getFile and getPackage.

2012-01-10 Thread James Antill
On Wed, 2012-01-04 at 10:45 -0500, Zdenek Pavlas wrote: > > > def _getFile(self, url=None, relative=None, local=None, > > > ... > > > -cache=True, size=None): > > > +cache=True, size=None, errorfunc=None): > > > > Just a minor thing, but this will break rhn-plugin ...

Re: [Yum-devel] [PATCH] quote 'proxy_username' and 'proxy_password'. BZ 770117

2012-01-10 Thread James Antill
On Tue, 2012-01-10 at 18:10 +0100, Zdeněk Pavlas wrote: > HTTP/FTP client has to parse the proxy user/pass from > proxy url, which uses ':' and '@' as delimiters. Such > characters have to be quoted. Quoting uses '%' so we > have to quote it as well. > > An option is to use module urllib or urll

[Yum-devel] [PATCH] quote 'proxy_username' and 'proxy_password'. BZ 770117

2012-01-10 Thread Zdeněk Pavlas
HTTP/FTP client has to parse the proxy user/pass from proxy url, which uses ':' and '@' as delimiters. Such characters have to be quoted. Quoting uses '%' so we have to quote it as well. An option is to use module urllib or urllib2, but yum seems to try not to depend on these. --- yum/yumRepo.p

Re: [Yum-devel] [PATCH 1/2] add misc.parse_pattern()

2012-01-10 Thread Nils Philippsen
A bit late, but... On Mon, 2011-12-19 at 17:13 +0100, Zdeněk Pavlas wrote: > +def parse_pattern(pattern): > +""" Split a string to a list of package or group patterns. > +""" > +assert type(pattern) == str ... this strikes me as odd in two ways: 1) why check for the exact type, and n

Re: [Yum-devel] [PATCH 2/3] Add argument 'errorfunc' to _getFile and getPackage.

2012-01-10 Thread Nils Philippsen
On Wed, 2012-01-04 at 10:45 -0500, Zdenek Pavlas wrote: > @@ -906,6 +907,23 @@ Insufficient space in download directory %s > return local > misc.unlink_f(local) > > +if not 'errorfunc' in self._getFile.im_func.func_code.co_varnames: Rather than doing this an