|Summary:||reposync of rhn repositories ignores repoid specified|
|Product:||Red Hat Enterprise Linux 6||Reporter:||Steven Seed <Steven.Seed>|
|Component:||yum-utils||Assignee:||James Antill <james.antill>|
|Status:||CLOSED DUPLICATE||QA Contact:||Red Hat Satellite QA List <satellite-qa-list>|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2011-08-25 15:04:53 UTC||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
Description Steven Seed 2011-08-25 00:27:16 UTC
Description of problem: reposync on RHEL6 behaves differently from RHEL5 when it comes to syncing rhn repositories. It seems that the repoid specified as a command line flag is ignored (at least with respect to rhn repos). In other words if I specify a repoid of rhel-x86_64-workstation-6, the rhn plugin will override this choice and enalbe all repos the host is subscribed to on rhn. The result is reposync transfers all repos in rhn that the host has a subscription for. Version-Release number of selected component (if applicable): yum-utils-1.1.30-6.el6.noarch yum-rhn-plugin-0.9.1-26.el6_1.1.noarch How reproducible: Always Steps to Reproduce: 1. register host with rhn (in this case RHEL Workstation 6) 2. run reposync command (/usr/bin/reposync -l -m -d -n -r rhel-x86_64-workstation-6 --download_path=/var/repo_mirror -a x86_64) Actual results: reposync syncs all repos including: rhel-x86_64-workstation-6 rhel-x86_64-workstation-6-debuginfo rhel-x86_64-workstation-optional-6 rhel-x86_64-workstation-optional-6-debuginfo rhel-x86_64-workstation-supplementary-6 rhel-x86_64-workstation-supplementary-6-debuginfo rhn-tools-rhel-x86_64-workstation-6 Expected results: reposync should only sync rhel-x86_64-workstation-6 Additional info: As far as I can tell this problem comes about in the reposync script (/usr/bin/reposyc) when it calls my.doRepoSetup (line 191) after it's gone and determined which repos to enable/disable (based on the repoid passed in). This call ultimately calls doSetup in repos.py (/usr/lib/python2.6/site-packages/yum/repos.py). The first line in this function is where the problem occurs because is calls 'prereposetup' in the rhnplugin: def doSetup(self, thisrepo = None): self.ayum.plugins.run('prereposetup') if thisrepo is None: repos = self.listEnabled() else: repos = self.findRepos(thisrepo) ... In the above snippet, the prereposetup that is executed in the rhnplugin overwrites the enalbed rhn repos in the repo object with all the rhn repos currently subscribed. The result of self.listEnalbed() is changed after this point. A workaround I've put in place, though I'm not sure of the fallout is to move the call to 'my.doRepoSetup()' in reposync before the section that enables/disables the repos. This way, it properly disables the repos after the rhnplugin enables them. Here is the snippet (starting at line 162): ... elif opts.cachedir: my.repos.setCacheDir(opts.cachedir) my.doRepoSetup() ### New position of this call if len(opts.repoid) > 0: myrepos =  # find the ones we want for glob in opts.repoid: myrepos.extend(my.repos.findRepos(glob)) # disable them all for repo in my.repos.repos.values(): repo.disable() # enable the ones we like for repo in myrepos: repo.enable() # --norepopath can only be sensibly used with a single repository: if len(my.repos.listEnabled()) > 1 and opts.norepopath: 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() try: arches = rpmUtils.arch.getArchList(opts.arch) ...
Comment 2 James Antill 2011-08-25 15:04:53 UTC
Yeh, it's already fixed for 6.2 ... basically the workaround you thought. I've also heard rumours that rhnplugin might be fixed as well. *** This bug has been marked as a duplicate of bug 713108 ***
Comment 3 Steven Seed 2011-08-25 18:50:08 UTC
OK. Great. Thanks!