[Yum-devel] Problem using doConfigSetup()

Brad Smith usernamenumber at gmail.com
Wed Feb 14 05:59:06 UTC 2007


Hello all,

I'm attempting to make maintenance of Fedora Tracker easier by
replacing as much of the back-end as possible with yum code. Since
Tracker runs as non-root, it seemed that the easiest way to do this
would be to create a trackerRoot directory with its own config files,
cache directory, etc. I looked at the code for
YumBase.doGenericSetup() and basically followed that with one extra
argument to doConfigSetup() to get Yum to use the nonstandard
directory. The repo file being used is a standard fedora-core.repo and
doGenericSetup() works, and yet...

>>> import yum
>>> my=yum.YumBase()
>>> my.doConfigSetup(root="/home/brad/Work/yum/trackerRoot")
Loading "installonlyn" plugin

>>> my.conf.cache=0
>>> my.doTsSetup()
>>> my.doRpmDBSetup()
>>> my.doRepoSetup()
Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "yum/__init__.py", line 309, in doRepoSetup
    repo.setup(self.conf.cache, self.mediagrabber)
  File "yum/yumRepo.py", line 585, in setup
    self.baseurlSetup()
  File "yum/yumRepo.py", line 428, in baseurlSetup
    self.check()
  File "yum/yumRepo.py", line 312, in check
    raise Errors.RepoError, \
RepoError: Cannot find a valid baseurl for repo: core

The procedure above duplicates what the source says doGenericSetup()
does, and yet it acts as though there's something wrong with the .repo
file when I do it, but not when doGenericSetup() does it. Obviously
I'm missing something here. Does anyone have an idea what?

Thanks,
--Brad



More information about the Yum-devel mailing list