Bug 1404253 - Get rid of dnf module import error in the logs
Summary: Get rid of dnf module import error in the logs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: otopi
Classification: oVirt
Component: Plugins.packagers
Version: 1.6.0
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ovirt-4.1.1
: 1.6.1
Assignee: Sandro Bonazzola
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-13 13:31 UTC by Sandro Bonazzola
Modified: 2017-05-11 09:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-21 09:38:14 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 72177 0 'None' 'MERGED' 'dnfpackager: do not print traceback when fail to import dnf' 2019-12-05 08:46:17 UTC
oVirt gerrit 72188 0 'None' 'MERGED' 'dnfpackager: do not print traceback when fail to import dnf' 2019-12-05 08:46:17 UTC

Description Sandro Bonazzola 2016-12-13 13:31:01 UTC
Description of problem:
On RHEL / CentOS systems otopi based tools logs something like:

2016-12-12 16:27:07 DEBUG otopi.plugins.otopi.packagers.dnfpackager dnfpackager._boot:163 Cannot initialize minidnf
Traceback (most recent call last):
  File "/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py", line 150, in _boot
    constants.PackEnv.DNF_DISABLED_PLUGINS
  File "/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py", line 60, in _getMiniDNF
    from otopi import minidnf
  File "/usr/lib/python2.7/site-packages/otopi/minidnf.py", line 16, in <module>
    import dnf
ImportError: No module named dnf

because we try to use dnf and fallback to yum if dnf is not found.
This is harmless but mislead people debugging other issues.
Let's remove the trace from the logs.

Comment 1 Lukas Svaty 2017-04-04 14:10:13 UTC
Only this message is displayed no traceback:

2017-04-04 16:03:04 DEBUG otopi.plugins.otopi.packagers.dnfpackager dnfpackager._boot:166 Cannot initialize minidnf

verified in otopi-1.6.1-1.el7ev.noarch


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