[Yum-devel] API question: reset all repos

Jack Neely jjneely at ncsu.edu
Tue Jan 10 22:41:03 UTC 2012


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 driver -- Yum reads in all its configuration.

2. Bcfg2 attempts to install packages and files.  Yum tells us we don't
know anything about the google-chrome-stable package.  Bcfg2 happily
installs the google-chrome.repo file.

3. Changes made, but configuration state still unclean.  Bcfg2 attempts
to install the still missing package: google-chrome-stable.  Yum says it
doesn't know anything about this package as it hasn't re-read its .repo
files.

4. Configuration state still dirty, but no more changes can be made.
Exit.

So, every time I get to the install packages method I'd like to make
sure Yum knows about any repos that may have been potentially added...or
taken away.

I've looked at running YumBase.close() or YumBase._delRepos(), even
followed by a doConfigSetup() but all I seem to get is a corrupted
configuration in memory and Yum isn't able to install any package.

Thanks,
Jack Neely
-- 
Jack Neely <jjneely at ncsu.edu>
Linux Czar, OIT Campus Linux Services
Office of Information Technology, NC State University
GPG Fingerprint: 1917 5AC1 E828 9337 7AA4  EA6B 213B 765F 3B6A 5B89


More information about the Yum-devel mailing list