Bug 713108

Summary: reposync -l -r <repoid> do not work with RHN channels
Product: Red Hat Enterprise Linux 6 Reporter: Kirby Zhou <kirbyzhou>
Component: yum-utilsAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: ksrot, pknirsch, spurrier, Steven.Seed
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 17:35:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kirby Zhou 2011-06-14 10:20:33 UTC
Description of problem:

reposync -l -r <repoid> do not work with RHN channels.

if the repoid is disabled in the rhnplugin.conf, then the '-r' option can not turn it enabled. if the repoid is enabled, it is always enabled when run reposync with '-r' option.

Version-Release number of selected component (if applicable):

yum-utils-1.1.30-6.el6.noarch
yum-3.2.29-17.el6.noarch
yum-rhn-plugin-0.9.1-26.el6_1.1.noarch


How reproducible:

100%

Steps to Reproduce:
1. add rhel-x86_64-server-6 and rhel-x86_64-server-fastrack-6 channle by rhn-channel command.

2. modify /etc/yum/pluginconf.d/rhnplugin.conf like this:
[main]
enabled = 1
gpgcheck = 1

[rhel-x86_64-server-6]
enabled = 0
[rhel-x86_64-server-fastrack-6]
enabled = 0

3. run reposync

reposync -g -n -l -m -r rhel-x86_64-server-fastrack-6
  
Actual results:

Nothing downloaded.

Expected results:

The channel rhel-x86_64-server-fastrack-6 should be downloaded.

Additional info:

The rhnplugin will be called with doRepoSetup, and it clears then enabled/disabled state of repo. Maybe we should call doRepoSetup before adjust the state of repo.

Patch like this:

--- /usr/bin/reposync   2011-03-23 02:16:06.000000000 +0800
+++ ./reposync  2011-06-14 18:10:16.224086724 +0800
@@ -162,6 +162,14 @@
     elif opts.cachedir:
         my.repos.setCacheDir(opts.cachedir)
 
+    # Use progress bar display when downloading repo metadata
+    # and package files
+    if not opts.quiet:
+        my.repos.setProgressBar(TextMeter(fo=sys.stdout))
+
+    my.doRpmDBSetup()
+    my.doRepoSetup()
+
     if len(opts.repoid) > 0:
         myrepos = []
         
@@ -182,13 +190,6 @@
         print >> sys.stderr, "Error: Can't use --norepopath with multiple repositories"
         sys.exit(1)
 
-    # Use progress bar display when downloading repo metadata
-    # and package files
-    if not opts.quiet:
-        my.repos.setProgressBar(TextMeter(fo=sys.stdout))
-
-    my.doRpmDBSetup()
-    my.doRepoSetup()
     try:
         arches = rpmUtils.arch.getArchList(opts.arch)
         if opts.source:

Comment 3 James Antill 2011-08-25 15:04:53 UTC
*** Bug 733165 has been marked as a duplicate of this bug. ***

Comment 7 errata-xmlrpc 2011-12-06 17:35:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1703.html