Description of problem: I'm trying to use dnf to resolve dependencies from a custom repo created in my code, but I keep getting OSError (see below). Version-Release number of selected component (if applicable): python3-dnf-0.5.3-1.fc20.noarch python3-hawkey-0.4.17-1.fc20.x86_64 How reproducible: a python3 snippet of code: base = dnf.Base() rawhide = dnf.repo.Repo('rawhide', basecachedir='/tmp') rawhide.baseurl.append( 'http://download.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/') base.repos.add(rawhide) base.fill_sack(load_system_repo=False) Actual results: File "./dnf-livecd.py", line 81, in resolve base.fill_sack(load_system_repo=False) File "/usr/lib/python3.3/site-packages/dnf/base.py", line 203, in fill_sack self._add_repo_to_sack(r.id) File "/usr/lib/python3.3/site-packages/dnf/base.py", line 119, in _add_repo_to_sack load_presto=repo.deltarpm) OSError: Can not read repomd file. Expected results: This should pass silently and fill the sack from given repo. Additional info: Currently this is probably not even supposed to work right now, but I think this use case should be covered (in both docs and code).
Thanks Slavek, we'll take a look.
By coincidence, I'm playing with the same code in unit tests now. I'm pretty sure that the problem is in the permissions to the cache directory. I guess that the same code run under the root privileges will run OK.
To aid in debugging similar problems for the client code hawkey commit ef2ca49 improves error reporting, in the comment 0 case the correct exception message will be: OSError: Can not create temporary file: /var/cache/dnf/rawhide.solv.3Ro6Ur.
Commit c9452cc upstream improves the documentation ands adds an example for the describe scenario: http://dnf.readthedocs.org/en/latest/api_base.html#dnf.Base.fill_sack Note that I mystified you at one point: Repo() in fact already has a documented constructor in the API: http://dnf.readthedocs.org/en/latest/api_repos.html#dnf.repo.Repo.__init__
Thank you, works like a charm.