Bug 1196416 - rhn-migrate-classic-to-rhsm with --activation-key option should not prompt for destination credentials
Summary: rhn-migrate-classic-to-rhsm with --activation-key option should not prompt fo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.7
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
: 1123025 (view as bug list)
Depends On:
Blocks: rhsm-rhel72 rhsm-rhel67
TreeView+ depends on / blocked
 
Reported: 2015-02-25 23:12 UTC by John Sefler
Modified: 2015-07-22 06:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-22 06:53:11 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1345 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2015-07-20 17:59:53 UTC

Description John Sefler 2015-02-25 23:12:44 UTC
Description of problem:
After implementation of RFE Bug 1154375, the rhn-migrate-classic-to-rhsm tool now allows the user to specify an --activation-key option.

Following the usage rules of subscription-manager register with an activation key, a few fixes are needed...

1. if rhn-migrate-classic-to-rhsm is run with the --activation-key option, then there should not be any interactive prompting for destination-user and destination-password

2. if rhn-migrate-classic-to-rhsm is run with the --activation-key option, then either the --org must be specified or interactively prompted.


Version-Release number of selected component (if applicable):
[root@jsefler-os6 ~]# rpm -q subscription-manager
subscription-manager-1.14.1-1.git.37.61e53ff.el6.x86_64



Additional info:
In my opinion, there is no need for interactive prompting of an activation-key (as currently implemented).  If this is desired in the future, then it would need to occur before the destination credential prompts.  Moreover, we would need a way to say "I don't have an activation-key".

Comment 1 Alex Wood 2015-04-07 15:37:47 UTC
*** Bug 1123025 has been marked as a duplicate of this bug. ***

Comment 2 Alex Wood 2015-04-08 14:17:47 UTC
commit e6ee0dac25ac3cf6adc0d52779e6c806e7f62799
Author: Alex Wood <awood@redhat.com>
Date:   Thu Feb 26 16:10:46 2015 -0500

    1196416: Migration should not need credentials with activation keys
    
    Also addresses 1196396

Comment 4 Shwetha Kallesh 2015-04-14 07:06:20 UTC
[root@dhcp35-236 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.47-1
subscription management rules: 5.14
subscription-manager: 1.14.3-1.el6
python-rhsm: 1.14.2-1.el6


Doesnot ask for destination user and password when rhn-migrate-classic-to-rhsm is used with activation-key

[root@dhcp35-236 ~]# rhn-migrate-classic-to-rhsm --activation-key rhn_migration_test --org admin
Legacy username: qa@redhat.com
Legacy password: 

Retrieving existing legacy subscription information...

+-----------------------------------------------------+
System is currently subscribed to these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

+-----------------------------------------------------+
Installing product certificates for these legacy channels:
+-----------------------------------------------------+
rhel-x86_64-server-6

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

Preparing to unregister system from legacy server...
System successfully unregistered from legacy server.

Attempting to register system to destination server...
The system has been registered with ID: 5f7fa230-b638-4d96-b33e-496aa9a2bb3a 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Not Subscribed

Product Name: Awesome OS Server Bits
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.
System 'dhcp35-236.lab.eng.blr.redhat.com' successfully registered.


--------------------------------------------------------------------------
--------------------------------------------------------------------------

When org is not specified with activation-key , a message is displayed to user ,but there is no prompting for --org

[root@dhcp35-236 ~]# rhn-migrate-classic-to-rhsm --activation-key foo
The --activation-key option requires that a --org be given.

Comment 5 Alex Wood 2015-04-14 14:00:31 UTC
> When org is not specified with activation-key , a message is displayed to
> user ,but there is no prompting for --org
> 
> [root@dhcp35-236 ~]# rhn-migrate-classic-to-rhsm --activation-key foo
> The --activation-key option requires that a --org be given.

Not asking for an org in this situation is by design.  The primary use case for the --activation-key option was that administrators would be using it in scripts.  If we prompted for an org, the script would just sit forever waiting for input that would never appear.  Instead, I decided to make the tool fail immediately if an organization was not specified so that script authors would immediately get feedback.

Comment 6 Shwetha Kallesh 2015-04-15 06:12:26 UTC
(In reply to Alex Wood from comment #5)
> > When org is not specified with activation-key , a message is displayed to
> > user ,but there is no prompting for --org
> > 
> > [root@dhcp35-236 ~]# rhn-migrate-classic-to-rhsm --activation-key foo
> > The --activation-key option requires that a --org be given.
> 
> Not asking for an org in this situation is by design.  The primary use case
> for the --activation-key option was that administrators would be using it in
> scripts.  If we prompted for an org, the script would just sit forever
> waiting for input that would never appear.  Instead, I decided to make the
> tool fail immediately if an organization was not specified so that script
> authors would immediately get feedback.

Thanks for the clarification,moving the bug to verified as it is working as designed.

Comment 7 errata-xmlrpc 2015-07-22 06:53:11 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.

https://rhn.redhat.com/errata/RHBA-2015-1345.html


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