Bug 842768 - subscription-manager options --baseurl and --serverurl should be restricted to the register module
Summary: subscription-manager options --baseurl and --serverurl should be restricted t...
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-07-24 14:43 UTC by John Sefler
Modified: 2013-01-08 03:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Overly broad options parsing. Consequence: The --baseurl and --serverurl options were being provided for a wide number of subcommands where they had no meaning. Fix: Restrict these options to only commands that need them. Result: The --baseurl and --serverurl options only appear where appropriate.
Clone Of:
Environment:
Last Closed: 2013-01-08 03:57:38 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-07-24 14:43:48 UTC
Description of problem:
Two new options (--baseurl and --serverurl) have been added to subscription-manager to help a user specify several connection related configurations all in one call to register a system.

The addition of these two parameters has permeated more than just the register module.  They are currently accessible from all of the following modules:
  register
  unregister
  subscribe
  unsubscribe
  list
  environments
  refresh
  redeem
  identity
  service-level
  facts
  orgs


In my opinion, the --baseurl and --serverurl options are only useful on the register module.  A user would not want to successfully register using one serverurl and then attempt to unregister with a different serverurl.

If the baseurl had to be changed after a subscription is given, then the config module should be used.  The config module is the catch-all module that can be used to set any/all the configurations including server and baseurl values.


Version-Release number of selected component (if applicable):
[root@jsefler-rhel59 ~]# rpm -q subscription-manager
subscription-manager-1.0.9-1.git.37.53fde9a.el5


How reproducible:


Steps to Reproduce:
1. subscription-manager MODULE --help
   where MODULE is in the list above

  
Actual results:


Expected results:
Only subscription-manager register --help should grant access to the --baseurl and --serverurl options.


Additional info:

Comment 1 RHEL Program Management 2012-07-24 14:58:53 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-07-30 13:53:26 UTC
changing severity from medium to high because I would not want to make these options available to several subscription-manager modules for rhel59 and then take them away in an update.

Comment 3 John Sefler 2012-08-02 12:59:10 UTC
Upon further thought, it would make sense to also include the --serverurl option with subscription-manager modules:  redeem, orgs, and environments.   But it would not make sense to include --baseurl as an option for these modules.

Comment 4 John Sefler 2012-08-02 13:12:42 UTC
(In reply to comment #3)
> Upon further thought, it would make sense to also include the --serverurl
> option with subscription-manager modules:  redeem, orgs, and environments.
and service-level too
> But it would not make sense to include --baseurl as an option for these
> modules.

Comment 5 Alex Wood 2012-09-14 15:10:39 UTC
commit b87b9751487fe9518fc436b181ab59e9dfe06ab1
Author: Alex Wood <awood>
Date:   Wed Sep 12 15:27:06 2012 -0400

    842768: Limit --serverurl and --baseurl to specific commands.

Available subscription-manager-1.0.19-1+

Comment 7 John Sefler 2012-09-17 20:36:06 UTC
Comment 3 says to include --serverurl as an option to module redeem.  This is NOT a good idea.  Because the redeem module requires that the system be registered first, then the --serverurl would already have been used during register and therefore passing --serverurl with redeem is not necessary and potentially destructive.

Please remove --serverurl as an option to redeem module.
(Sorry awood for the change of heart)

Moving back to ASSIGNED

Comment 8 Alex Wood 2012-09-18 13:24:08 UTC
commit 82d1aed515d9cf9feb5898fe3d7203ba12d6babc
Author: Alex Wood <awood>
Date:   Mon Sep 17 16:48:22 2012 -0400

    842768: Remove --serverurl option from redeem command.

Available subscription-manager-1.0.19-1+

Comment 10 Shwetha Kallesh 2012-10-11 09:27:52 UTC
Marking verified!!

[root@localhost entitlement]# subscription-manager version
registered to: 0.7.13-1
server type: subscription management service
subscription-manager: 1.0.22-1.el5
python-rhsm: 1.0.10-1.el5


[root@localhost entitlement]# subscription-manager MODULE --help


Usage: subscription-manager MODULE-NAME [MODULE-OPTIONS] [--help]


Primary Modules:

	list           List subscription and product information for this machine
	refresh        Pull the latest subscription data from the server
	register       register the client to the Customer Portal or another subscription management service.
	release        Configure what os release to use
	subscribe      Subscribe the registered machine to a specified product
	unregister     unregister the client from the Customer Portal or another subscription management service.
	unsubscribe    Unsubscribe the machine from all or specific subscriptions

Other Modules (Please consult documentation):

	clean          Remove all local consumer and subscription data without affecting the server
	config         List, set, or remove the configuration parameters in use by this machine
	environments   Display the environments available for a user
	facts          View or update the detected system information
	identity       Display the identity certificate for this machine or request a new one
	import         Import certificates which were provided outside of the tool
	orgs           Display the orgs against which a user can register a system
	redeem         Attempt to redeem a subscription for a preconfigured machine
	repos          List the repos which this machine is entitled to use
	service-level  Manage service levels for this system
	version        Print version information


[root@localhost entitlement]# subscription-manager redeem --help | grep serverurl

[root@localhost entitlement]# subscription-manager service-level --help | grep serverurl
  --serverurl=SERVER_URL
[root@localhost entitlement]# subscription-manager service-level --help | grep baseurl
[root@localhost entitlement]# subscription-manager redeem --help | grep baseurl

[root@localhost entitlement]# subscription-manager orgs --help | grep baseurl
[root@localhost entitlement]# subscription-manager orgs --help | grep serverurl
  --serverurl=SERVER_URL
[root@localhost entitlement]# subscription-manager environments --help | grep serverurl
  --serverurl=SERVER_URL
[root@localhost entitlement]# subscription-manager environments --help | grep baseurl
[root@localhost entitlement]#

Comment 12 errata-xmlrpc 2013-01-08 03:57:38 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.