Bug 1264027

Summary: plugin doesn't accept parameter --enablerepo for spacewalk repos
Product: [Fedora] Fedora Reporter: Pavel Studeník <pstudeni>
Component: dnfAssignee: Michael Mráka <mmraka>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: jdobes, jsilhan, mluscon, mmraka, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-12 14:10:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Studeník 2015-09-17 10:53:07 UTC
Description of problem:
I try enable only one spacewalk repository, but parameter "--enablerepo" doesn't work correct 

# dnf repolist --disablerepo=* --enablerepo=spacewalk-client-fedora-22
Error: Unknown repo: 'spacewalk-client-fedora-22'

# dnf repolist --disablerepo=* --enablerepo=spacewalk-client-*
Error: Unknown repo: 'spacewalk-client-*'

# rhn-channel --list
fedora-22-x86_64
spacewalk-client-fedora-22

# dnf repolist
This system is receiving updates from Spacewalk server.
Last metadata expiration check performed 2:15:23 ago on Thu Sep 17 08:28:45 2015.
repo id
beaker-Fedora
beaker-Fedora-Everything
beaker-Server-debuginfo
...
fedora-22-x86_64
spacewalk-client-fedora-22


Version-Release number of selected component (if applicable):
dnf-plugin-spacewalk-2.4.15-1.fc22.noarch

How reproducible:
always

Steps to Reproduce:
1. register system to spacewalk with some channels
2. run following command

# for it in $(rhn-channel --list); do dnf repolist --disablerepo=* --enablerepo=$it; done
Error: Unknown repo: 'fedora-22-x86_64'
Error: Unknown repo: 'spacewalk-client-fedora-22'


Expected results:

# for it in $(rhn-channel --list); do yum repolist --disablerepo=* --enablerepo=$it; done
Zavedeny zásuvné moduly: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
rhel-x86_64-server-6
...

Comment 1 Pavel Studeník 2015-10-22 13:56:05 UTC
I looked at the code and dnf finished with failed before spacewalk plugin is loaded. It isn't good behaviour.

Workaround is possible

# dnf repolist --disablerepo=* --enablerepo=spacewalk-client-nightly*

I suppose that this bug is problem of dnf application.

Comment 2 Michael Mráka 2015-11-12 14:10:53 UTC
> I suppose that this bug is problem of dnf application.

Well, yes exactly. This is actually a problem in dnf design. The arguments are parsed before the plugin can even run its __init__() so repos dynamicaly created in plugin aren't taken into account.

Unfortunately this can't be fixed without major redesign/rewrite.