Description of problem:
I've been playing with dnf and found out I have to set dnf.Base.conf.cachedir to a desired value before I call dnf.Base.read_all_repos() otherwise my script dies with an exception. See Bug 1184943 comment 2 for more details.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
dnf uses the system directory for its cache
dnf uses the provided directory for its cache or dnf documentation reflects this fact (or you can switch from dnf.Base.conf.cachedir variable to dnf.Base.conf.cachedir() function and spit a warning).
*** This bug has been marked as a duplicate of bug 1184943 ***