Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 827765 Details for
Bug 1033596
dnf API base.do_transaction fails in python3
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
test py file
dnf-api.py (text/plain), 1.63 KB, created by
Tim Lauridsen
on 2013-11-22 12:58:54 UTC
(
hide
)
Description:
test py file
Filename:
MIME Type:
Creator:
Tim Lauridsen
Created:
2013-11-22 12:58:54 UTC
Size:
1.63 KB
patch
obsolete
>#!/usr/bin/python3 > ># dnf API usage example ># ># dnf 0.4.8 ># > > >from __future__ import print_function >import dnf >import dnf.yum >import dnf.const >import dnf.conf >import dnf.subject >from dnf import Base >import os >import os.path > >class MyBase(dnf.Base): > > def __init__(self): > dnf.Base.__init__(self) > self.setup_cache() > self.read_all_repos() # NON API > self.fill_sack() > > def setup_cache(self): > # perform the CLI-specific cachedir tricks > conf = self.conf > #conf.read() # Read the conf file from disk > conf.releasever = '20' > # conf.cachedir = CACHE_DIR # hardcoded cache dir > # This is not public API, but we want the same cache as dnf cli > suffix = dnf.yum.parser.varReplace(dnf.const.CACHEDIR_SUFFIX, conf.yumvar) > cli_cache = dnf.conf.CliCache(conf.cachedir, suffix) > conf.cachedir = cli_cache.cachedir > self._system_cachedir = cli_cache.system_cachedir > print("cachedir: %s" % conf.cachedir) > > > def do_install(self): > print("=============== install btanks =====================") > rc = self.install('btanks') > print("# of packages added : %d" % rc) > print(self._goal) > rc = self.resolve() > to_dnl = [] > for tsi in self.transaction: > print(" "+tsi.active_history_state+" - "+ str(tsi.active) ) > if tsi.installed: > to_dnl.append(tsi.installed) > print(to_dnl) > print("Downloading Packages") > print(self.download_packages(to_dnl)) > print("Running Transaction") > print(self.do_transaction()) > >base = MyBase() >base.do_install()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1033596
: 827765