Bug 734492

Summary: Package Manager GUI forces re-register of system even if registered correctly
Product: Red Hat Enterprise Linux 5 Reporter: Jack Waterworth <jwaterwo>
Component: yum-rhn-pluginAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED ERRATA QA Contact: Martin Minar <mminar>
Severity: high Docs Contact:
Priority: urgent    
Version: 5.7CC: cecilhsujp, cperry, fdewaley, ianauati, jpallich, jturner, jwest, mfuruta, mhuth, mkoci, mmello, mminar, mmraka, pep, pmutha, rdassen
Target Milestone: rcKeywords: Regression, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 06:29:02 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:
Bug Depends On:    
Bug Blocks: 736250    

Description Jack Waterworth 2011-08-30 15:09:05 UTC
Description of problem:
Opening the Package Updater GUI redirects user to the rhn_register GUI screen, even if registered correctly. The register screen then displays a warning that the machine is already registered.  Running `yum update` from the command line works fine and is unaffected by this issue.


Version-Release number of selected component (if applicable):
yum-rhn-plugin-0.5.4-22.el5_7.1


How reproducible:
Every time


Steps to Reproduce:
1. Upgrade yum-rhn-plugin from 0.5.4-22.el5 to 0.5.4-22.el5_7.1
2. Run Package Updater
  
Actual results:
RHN Registration process is started with warning that the machine is already registered


Expected results:
Package Updater displays out-of-date packages eligible for upgrade.


Additional info:
To work around this issue, you can downgrade the package to 0.5.4-22.el5 with the following command
    # yum downgrade yum-rhn-plugin

However, the package update then prompts the user to upgrade this package again.

Comment 2 Mark Huth 2011-08-31 23:57:08 UTC
Related issue: https://bugzilla.redhat.com/show_bug.cgi?id=734965

Comment 4 Milan Zázrivec 2011-09-02 16:16:01 UTC
Here's what's going on.

Here's the piece of code from pup, which decides whether it needs to run
rhn_register:


if not self.registered and len(self.repos.listEnabled()) == 0:
    ... # here we'll run rhn_register


self.registered is not interesting here.

Ordinarily (i.e. if you're registered), self.repos should be populated
with info about repos provided by RHN by yum-rhn-plugin.

The repo population magic happens in /usr/lib/yum-plugins/rhnplugin.py
in init_hook().

The problem here is that the init_hook() that went out in
yum-rhn-plugin-0.5.4-22.el5_7.1 contains the following check before it
actually populates the repositories information:


if ('--help' in cmd_args or '--version' in cmd_args or cmd_args == []):
        rhn_enabled = False
        return


So:
1. You run pup (without any command line arguments)
2. init_hook() will bail in the above check, not populating the repos info
3. pup in turn will see we have no repos enabled and will ask you to
register w/ RHN

Comment 5 Milan Zázrivec 2011-09-02 16:49:15 UTC
*** Bug 735246 has been marked as a duplicate of this bug. ***

Comment 6 Michael Mráka 2011-09-05 08:39:50 UTC
The issue has been fixed in spacewalk master by
commit e429437bd77eda75a76a3a52f72d744b54c30c37
    734492, 734965, 735282 - check command line options only for yum

Comment 11 errata-xmlrpc 2012-02-21 06:29:02 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-2012-0162.html