Bug 1117789 - [doc] [api] custom repos
[doc] [api] custom repos
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ales Kozumplik
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2014-07-09 07:55 EDT by Bohuslav "Slavek" Kabrda
Modified: 2014-09-30 19:42 EDT (History)
5 users (show)

See Also:
Fixed In Version: dnf-0.5.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-07-29 03:20:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bohuslav "Slavek" Kabrda 2014-07-09 07:55:53 EDT
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):

How reproducible:
a python3 snippet of code:

base = dnf.Base()
rawhide = dnf.repo.Repo('rawhide', basecachedir='/tmp')

Actual results:
  File "./dnf-livecd.py", line 81, in resolve
  File "/usr/lib/python3.3/site-packages/dnf/base.py", line 203, in fill_sack
  File "/usr/lib/python3.3/site-packages/dnf/base.py", line 119, in _add_repo_to_sack
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).
Comment 1 Ales Kozumplik 2014-07-09 07:59:12 EDT
Thanks Slavek, we'll take a look.
Comment 2 Radek Holy 2014-07-09 08:46:49 EDT
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.
Comment 3 Ales Kozumplik 2014-07-17 10:29:51 EDT
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.
Comment 4 Ales Kozumplik 2014-07-17 10:58:04 EDT
Commit c9452cc upstream improves the documentation ands adds an example for the describe scenario:


Note that I mystified you at one point: Repo() in fact already has a documented constructor in the API:

Comment 5 Bohuslav "Slavek" Kabrda 2014-07-18 07:15:14 EDT
Thank you, works like a charm.

Note You need to log in before you can comment on or make changes to this bug.