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 1001820 - Tab Completion: subscription-manager attach <tab tab>
Summary: Tab Completion: subscription-manager attach <tab tab>
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Carter Kozak
QA Contact: John Sefler
URL:
Whiteboard:
: 921222 1003010 (view as bug list)
Depends On:
Blocks: rhsm-rhel65
TreeView+ depends on / blocked
 
Reported: 2013-08-27 20:32 UTC by Sharath Dwaral
Modified: 2015-03-23 01:14 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: various subscription-manager subcommand auto completion displaying unnecessary characters or incorrect values. Consequence: Fix: Updated the tab completion scripts. Result:
Clone Of:
Environment:
Last Closed: 2013-11-21 21:28:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1659 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2013-11-20 21:53:10 UTC

Description Sharath Dwaral 2013-08-27 20:32:13 UTC
Description of problem:
subscription-manager subscribe - auto completion displaying an unnecessary character 

Version-Release number of selected component (if applicable):
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.23-1
subscription-manager: 1.9.5-1.el6
python-rhsm: 1.9.4-1.el6

How reproducible:
Always

Steps to Reproduce:

# subscription-manager attach <tab tab>
-h               --help           i--auto          --pool           --proxy          --proxypassword  --proxyuser      --quantity       --servicelevel 

# subscription-manager attach --help
Usage: subscription-manager attach [OPTIONS]

Attach a specified subscription to the registered system

Options:
  -h, --help            show this help message and exit
  --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --pool=POOL           the ID of the pool to attach (can be specified more
                        than once)
  --quantity=QUANTITY   number of subscriptions to attach
  --auto                automatically attach compatible subscriptions to this
                        system
  --servicelevel=SERVICE_LEVEL
                        service level to apply to this system


Actual results:
Shown Above

Expected results:
Tab completion gives you an option "i--auto" which is not an option as shown in --help (above)

Additional info:

Comment 2 Sharath Dwaral 2013-08-27 21:03:13 UTC
Description:

subscription-manager clean <tab tab> gives you more options which is wrong

Version:

Same as above

Reproducible all the time

# subscription-manager clean -
-h               --help           --proxy          --proxypassword  --proxyuser

Comment 3 Sharath Dwaral 2013-08-28 18:31:44 UTC
More discrepancies 

>>Command option: attach
subsscription-manager attach --pool <tab tab> 
hangs for a few seconds and/or does not display options

>>Command option: config
subsscription-manager config <tab tab> 
displayed with proxy options when it doesn't have any

>>Command option: import
subscription-manager import <tab tab> 
displayed with proxy options when it doesn't have any

>>Command option: list
subscription-manager list <tab tab> 
should not be display "status" as an option

>>Command option: orgs
subscription-manager orgs <tab tab> 
"insecure" and "serverurl" should be displayed as options

>>Command option: plugin
subscription-manager plugin <tab tab> 
displayed with proxy options when it doesn't have any

>>Command option: register
subscription-manager register <tab tab> 
"baseusrl" and "insecure" should be displayed as options

>>Command option: remove
subscription-manager remove serial <tab tab> 
hangs for a few seconds and/or does not display options

>>Command option: service-level
subscription-manager service-level <tab tab> 
"insecure" "username" and "password" should be displayed as options

>>Command option: subscribe
subscription-manager subscribe <tab tab> 
lists "i--auto" instead of "auto" as option

>>Command option: subscribe
subscription-manager subscribe --pool <tab tab> 
hangs for a few seconds and/or does not display options

>>Command option: attach
subscription-manager unsubscribe --serial <tab tab> 
hangs for a few seconds and/or does not display options

Comment 4 Sharath Dwaral 2013-08-28 18:42:02 UTC
>> In tab completion displaying -h or --help option after choosing an option displays differently. This is shown below


# subscription-manager repos <tab tab>
--disable        --enable         -h               --help           --list           --proxy          --proxypassword  --proxyuser

>> Say if i choose an option '--list' and tab complete again i get this

# subscription-manager repos --list -
--disable        --enable         -h               --help           --list           --proxy          --proxypassword  --proxyuser

>> Now choosing '-h' or '--help' will list help menu as shown

# subscription-manager repos --list --h
Usage: subscription-manager repos [OPTIONS]

List the repositories which this system is entitled to use

options:
  -h, --help            show this help message and exit
  --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --list                list known repos for this system
  --enable=REPOID       repo to enable (can be specified more than once).
                        Wildcards (* and ?) are supported.
  --disable=REPOID      repo to disable (can be specified more than once).
                        Wildcards (* and ?) are supported

>> choosing '--enable' with -h or --help throws error as shown

 subscription-manager repos --enable --help
Error: --help is not a valid repo ID. Use --list option to see valid repos.

>> The behavior is different. It errors out when the option expects a string value after it and it displays the help menu when it does not expect a string.

Comment 5 Carter Kozak 2013-08-30 13:34:53 UTC
*** Bug 1003010 has been marked as a duplicate of this bug. ***

Comment 6 John Sefler 2013-09-03 21:48:43 UTC
In my opinion, comment 4 is not a bug.

Comment 7 Sharath Dwaral 2013-09-04 13:43:04 UTC
*** Bug 921222 has been marked as a duplicate of this bug. ***

Comment 8 Sharath Dwaral 2013-09-04 13:47:22 UTC
 comment 4 could be ignored because the error message is pretty descriptive.

Comment 9 Carter Kozak 2013-09-11 17:42:46 UTC
commit 2412e8c966d1580dc9f6698b68cbbbb0cfe16e85
Author: ckozak <ckozak>
Date:   Tue Aug 27 17:07:17 2013 -0400

    1001820: fix autocompletion

Comment 11 John Sefler 2013-09-13 18:51:27 UTC
Testing Version...
[root@jsefler-6 ~]# rpm -q subscription-manager bash-completion
subscription-manager-1.9.6-1.el6.x86_64
bash-completion-1.3-7.el6.noarch


[root@jsefler-6 ~]# subscription-manager status --help
Usage: subscription-manager status [OPTIONS]

Show status information for this system's subscriptions and products

Options:
  -h, --help            show this help message and exit
  --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --ondate=ON_DATE      future date to check status on, defaults to today's
                        date (example: 2013-09-13)
[root@jsefler-6 ~]# subscription-manager status -<TAB><TAB>
-h               --help           --proxy          --proxypassword  --proxyuser

^^^ BANG! Also expected bash completion option for --ondate

Comment 12 Carter Kozak 2013-09-19 18:36:56 UTC
commit 1a4e71d8bd3ec1bd0faa9bbe166bd83ca09cee8a
Author: Carter Kozak <ckozak>
Date:   Sat Sep 14 10:04:34 2013 -0400

    1001820: added ondate to completion

Comment 13 Bryan Kearney 2013-09-26 18:19:43 UTC
fixed in subscription-manager-1.9.7-1

Comment 14 John Sefler 2013-09-27 16:50:33 UTC
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager bash-completion
subscription-manager-1.9.7-1.el6.x86_64
bash-completion-1.3-7.el6.noarch

[root@jsefler-6 ~]# subscription-manager status -<TAB><TAB>
-h               --help           --ondate         --proxy          --proxypassword  --proxyuser   


VERIFIED: Option --ondate is now included in the tab completion choices for the status module


QE Note: An automated BashCompletionTests.java has been implemented to assert all of the expected bash completions for subscription-manager module options.

Comment 15 errata-xmlrpc 2013-11-21 21:28: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.

http://rhn.redhat.com/errata/RHBA-2013-1659.html


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