Bug 849644 - rhn-migrate-classic-to-rhsm is not attempting to register when --no-auto is specified; it should register
Summary: rhn-migrate-classic-to-rhsm is not attempting to register when --no-auto is s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Alex Wood
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 771748
TreeView+ depends on / blocked
 
Reported: 2012-08-20 12:58 UTC by John Sefler
Modified: 2013-01-08 03:59 UTC (History)
2 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-01-08 03:59:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0033 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-01-08 08:38:27 UTC

Description John Sefler 2012-08-20 12:58:24 UTC
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
Password: 
System Engine Username: qa
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 Program Management 2012-08-20 13:18:30 UTC
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 19:08:35 UTC
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 19:32:30 UTC
commit 4f0987628b8930720dd9004c9a9d103cc2a770b3
Refs: <origin/awood/849644>, subscription-manager-1.0.14-1-3-g4f09876
Author:     Alex Wood <awood>
AuthorDate: Mon Aug 20 15:26:42 2012 -0400
Commit:     Alex Wood <awood>
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 21:02:22 UTC
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 --password=**** --force --norhnsd --nohardware --nopackages --novirtinfo

[root@jsefler-59server ~]# rhn-migrate-classic-to-rhsm --no-auto
Red Hat account: qa
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-08 03:59:32 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-2013-0033.html


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