Bug 1001820 - Tab Completion: subscription-manager attach <tab tab>
Tab Completion: subscription-manager attach <tab tab>
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.5
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Carter Kozak
John Sefler
:
: 921222 1003010 (view as bug list)
Depends On:
Blocks: rhsm-rhel65
  Show dependency treegraph
 
Reported: 2013-08-27 16:32 EDT by Sharath Dwaral
Modified: 2015-03-22 21:14 EDT (History)
9 users (show)

See Also:
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:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 16:28:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sharath Dwaral 2013-08-27 16:32:13 EDT
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 17:03:13 EDT
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 14:31:44 EDT
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 14:42:02 EDT
>> 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 09:34:53 EDT
*** Bug 1003010 has been marked as a duplicate of this bug. ***
Comment 6 John Sefler 2013-09-03 17:48:43 EDT
In my opinion, comment 4 is not a bug.
Comment 7 Sharath Dwaral 2013-09-04 09:43:04 EDT
*** Bug 921222 has been marked as a duplicate of this bug. ***
Comment 8 Sharath Dwaral 2013-09-04 09:47:22 EDT
 comment 4 could be ignored because the error message is pretty descriptive.
Comment 9 Carter Kozak 2013-09-11 13:42:46 EDT
commit 2412e8c966d1580dc9f6698b68cbbbb0cfe16e85
Author: ckozak <ckozak@redhat.com>
Date:   Tue Aug 27 17:07:17 2013 -0400

    1001820: fix autocompletion
Comment 11 John Sefler 2013-09-13 14:51:27 EDT
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 14:36:56 EDT
commit 1a4e71d8bd3ec1bd0faa9bbe166bd83ca09cee8a
Author: Carter Kozak <ckozak@redhat.com>
Date:   Sat Sep 14 10:04:34 2013 -0400

    1001820: added ondate to completion
Comment 13 Bryan Kearney 2013-09-26 14:19:43 EDT
fixed in subscription-manager-1.9.7-1
Comment 14 John Sefler 2013-09-27 12:50:33 EDT
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 16:28:11 EST
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.