[Yum-devel] API question: reset all repos

Zdenek Pavlas zpavlas at redhat.com
Wed Jan 11 14:28:20 UTC 2012


> 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.

Creating a new YumBase instance is the safest bet,
but you may also try the following.

'del b.repos' throw all repos away, and reinits
b._repos to an empty, uninitialized repo storage.

'b.prerepoconf' instructs the getter for self.repos
to run getReposFromConfig() and do some initialization.

>>> import yum
>>> b = yum.YumBase()
...
>>> del b.repos 
>>> b.prerepoconf = yum._YumPreRepoConf()
...



More information about the Yum-devel mailing list