Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1345 0 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>
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
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.