Bug 849644 - rhn-migrate-classic-to-rhsm is not attempting to register when --no-auto is specified; it should register
rhn-migrate-classic-to-rhsm is not attempting to register when --no-auto is s...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.9
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Alex Wood
Entitlement Bugs
:
Depends On:
Blocks: 771748
  Show dependency treegraph
 
Reported: 2012-08-20 08:58 EDT by John Sefler
Modified: 2013-01-07 22:59 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Improper logic in rhn-migrate-classic-to-rhsm. Consequence: User systems were not registered when the script was called with the --no-auto option. Fix: Correct the logic in the script. Result: User systems are now registered when the script is called with the --no-auto option.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-07 22:59:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Sefler 2012-08-20 08:58:24 EDT
Description of problem:
According to the on-line help, specifying --no-auto should simply not attempt to autosubscribe while registering to the Subscription Management service.  The problem is that the registration is also not being attempted when this option is specified.

[root@jsefler-rhel59 ~]# rhn-migrate-classic-to-rhsm --help | grep no-auto -A1
  -n, --no-auto         Don't execute the autosubscribe option while
                        registering with subscription manager.

                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        SEE, THE REGISTRATION SHOULD STILL BE ATTEMPTED


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


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel59 ~]# rhn-migrate-classic-to-rhsm --no-auto --serverurl=https://subscription.rhn.stage.redhat.com:443/subscription
Red Hat account: qa@redhat.com
Password: 
System Engine Username: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to:
+----------------------------------+
rhel-x86_64-server-5

List of channels for which certs are being copied
rhel-x86_64-server-5

Product certificates copied successfully to /etc/pki/product

Preparing to unregister system from RHN Classic ...
System successfully unregistered from RHN Classic.
[root@jsefler-rhel59 ~]# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

 
Actual results:
above

Expected results:
Despite the prompting for System Engine credentials, there was no attempt to register.  Expected the system to be registered to candlepin with no entitlements granted when --no-auto option is specified.


Additional info:
Comment 1 RHEL Product and Program Management 2012-08-20 09:18:30 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 2 John Sefler 2012-08-20 15:08:35 EDT
The following excerpt comes from the man page for rhn-migrate-classic-to-rhsm...

       -n, --no-auto
              Unsubscribes  the system from Red Hat Network Classic but does not subsequently register the system to Red Hat Network Subscription Management or subscribe the system to any entitlements.

Version 0.4                      July 18, 2012  rhn-migrate-classic-to-rhsm(8)


When this bug is fixed, the man page will have to be updated to reflect when --no-auto is specified, the system migration process will simply not attempt to auto-subscribe during the registration to the Red Hat Subscription Management service.
Comment 3 Alex Wood 2012-08-21 15:32:30 EDT
commit 4f0987628b8930720dd9004c9a9d103cc2a770b3
Refs: <origin/awood/849644>, subscription-manager-1.0.14-1-3-g4f09876
Author:     Alex Wood <awood@redhat.com>
AuthorDate: Mon Aug 20 15:26:42 2012 -0400
Commit:     Alex Wood <awood@redhat.com>
CommitDate: Mon Aug 20 15:27:56 2012 -0400

    849644: Calls made with --no-auto were not actually registering the system.
Comment 5 John Sefler 2012-08-31 17:02:22 EDT
Verifying version...
[root@jsefler-59server ~]# rpm -q subscription-manager-migration
subscription-manager-migration-1.0.17-1.el5


[root@jsefler-59server ~]# subscription-manager config --server.hostname=subscription.rhn.stage.redhat.com --server.port=443 --server.prefix=/subscription

[root@jsefler-59server ~]# rhnreg_ks --serverUrl=https://xmlrpc.rhn.code.stage.redhat.com/XMLRPC --username=qa@redhat.com --password=**** --force --norhnsd --nohardware --nopackages --novirtinfo

[root@jsefler-59server ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa@redhat.com
Password: 

Retrieving existing RHN Classic subscription information ...
+----------------------------------+
System is currently subscribed to these RHN Classic Channels:
+----------------------------------+
rhel-x86_64-server-5

+--------------------------------------------------+ 
Installing product certificates for these RHN Classic channels:
+--------------------------------------------------+
rhel-x86_64-server-5

Product certificates installed successfully to /etc/pki/product.

Preparing to unregister system from RHN Classic ...
System successfully unregistered from RHN Classic.

Attempting to register system to Red Hat Subscription Management ...
The system has been registered with id: c8f65405-e07f-4f35-bf8b-aae18e78aad7 
System 'jsefler-59server.usersys.redhat.com' successfully registered to Red Hat Subscription Management.

[root@jsefler-59server ~]# subscription-manager list --consumed
No consumed subscription pools to list

[root@jsefler-59server ~]# subscription-manager identity
Current identity is: c8f65405-e07f-4f35-bf8b-aae18e78aad7
name: jsefler-59server.usersys.redhat.com
org name: Quality Assurance
org id: 711497
[root@jsefler-59server ~]# 


VERIFIED: USING OPTION --no-auto SUCCEEDED TO MIGRATE THE SYSTEM WITHOUT ATTEMPTING TO AUTOSUBSCRIBE
Comment 7 errata-xmlrpc 2013-01-07 22:59:32 EST
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-2013-0033.html

Note You need to log in before you can comment on or make changes to this bug.