Bug 1404253

Summary: Get rid of dnf module import error in the logs
Product: [oVirt] otopi Reporter: Sandro Bonazzola <sbonazzo>
Component: Plugins.packagersAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: low Docs Contact:
Priority: high    
Version: 1.6.0CC: bugs, jbelka, lsvaty, oourfali, ylavi
Target Milestone: ovirt-4.1.1Flags: rule-engine: ovirt-4.1+
Target Release: 1.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-21 09:38:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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