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 1974641 - Tab completion of does not list all the options available under the new syspurpose submodules
Summary: Tab completion of does not list all the options available under the new syspu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: subscription-manager
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: beta
: 9.0
Assignee: mhorky
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-22 08:38 UTC by Rehana
Modified: 2022-05-17 16:29 UTC (History)
2 users (show)

Fixed In Version: subscription-manager-1.29.21-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 15:58:13 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2716 0 None Merged 1974641: Fix tab completion with multiple optional commands 2021-09-15 09:08:03 UTC
Red Hat Product Errata RHBA-2022:3984 0 None None None 2022-05-17 15:58:25 UTC

Description Rehana 2021-06-22 08:38:46 UTC
Description of problem:


Version-Release number of selected component (if applicable):
subscription management server: 4.1.0-1
subscription management rules: 5.41
subscription-manager: 1.29.15-1.git.0.5e9a992.el9

How reproducible:
always

Steps to Reproduce:
1.List the options under new role module
 
# subscription-manager syspurpose role --list -h
usage: subscription-manager syspurpose [OPTIONS] role [OPTIONS]

Show or modify the system purpose role setting

optional arguments:
  -h, --help            show this help message and exit
  --proxy PROXY_URL     proxy URL in the form of hostname:port
  --proxyuser PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --noproxy NO_PROXY    host suffixes that should bypass HTTP proxy
  --username USERNAME   username to use when authorizing against the server
  --password PASSWORD   password to use when authorizing against the server
  --token TOKEN         token to use when authorizing against the server
  --org ORG_KEY         specify organization
  --set SET             set role of system purpose
  --unset               unset role of system purpose
  --show                show this system's current role
  --list                list all role available


2.Check the tab completion options 
# subscription-manager syspurpose role --list --<tab><tab>
--help           --noproxy        --proxy          --proxypassword  --proxyuser      --show  
^^ Does not contain all the options 

3.Sceanrio 2 
subscription-manager syspurpose usage --<tab><tab>

# subscription-manager syspurpose usage -
-h               --list           --org            --proxy          --proxyuser      --show           --unset          
--help           --noproxy        --password       --proxypassword  --set            --token          --username

^^ Notice all options appear 

Now try to pick two options 


# subscription-manager syspurpose usage --username --<tab><tab>
--help           --noproxy        --proxy          --proxypassword  --proxyuser      --show

^^ Notice some of the options are now gone

Actual results:
tab completion is not working as expected under new `subscription-manager syspurpose` sub modules 

Expected results:
Tab completion should work for all the options 

Additional info:

Comment 1 Zdenek Petracek 2021-11-11 12:25:22 UTC
Version:
[root@kvm-08-guest11 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.29.19-1.git.119.033bf98.el9

Bash-completion:
[root@kvm-08-guest11 ~]# yum install bash-completion
Updating Subscription Management repositories.

This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.

Last metadata expiration check: 0:10:31 ago on Thu 11 Nov 2021 07:12:30 AM EST.
Package bash-completion-1:2.11-4.el9.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Pre-verifying 1:
[root@kvm-08-guest11 ~]# subscription-manager syspurpose role --list -h
usage: subscription-manager syspurpose role [OPTIONS]

Show or modify the system purpose role setting

optional arguments:
  -h, --help            show this help message and exit
  --proxy PROXY_URL     proxy URL in the form of hostname:port
  --proxyuser PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --noproxy NO_PROXY    host suffixes that should bypass HTTP proxy
  --username USERNAME   username to use when authorizing against the server
  --password PASSWORD   password to use when authorizing against the server
  --token TOKEN         token to use when authorizing against the server
  --org ORG_KEY         specify an organization
  --set SET             set role of system purpose
  --unset               unset role of system purpose
  --show                show this system's current role
  --list                list all role available

Pre-verifying 2:
[root@kvm-08-guest11 ~]# subscription-manager syspurpose role --list --<tab><tab>
--help           --noproxy        --password       --proxypassword  --set            --token          --username       
--list           --org            --proxy          --proxyuser      --show           --unset          
^^ shows all the options --> PASSED

Pre-verifying 3:
[root@kvm-08-guest11 ~]# subscription-manager syspurpose usage --list --<tab><tab>
--help           --noproxy        --password       --proxypassword  --set            --token          --username       
--list           --org            --proxy          --proxyuser      --show           --unset          
^^ shows all the options --> PASSED

Pre-verifying 4 - picking 2 options:
[root@kvm-08-guest11 ~]# subscription-manager syspurpose usage --username --<tab><tab>
--help           --noproxy        --password       --proxypassword  --set            --token          --username       
--list           --org            --proxy          --proxyuser      --show           --unset          
^^ shows all the options --> PASSED

Comment 6 Rehana 2021-12-01 11:53:28 UTC
Verifying on :

# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.21-1
subscription management rules: 5.41
subscription-manager: 1.29.21-1.el9

# rpm -q subscription-manager --changelog | grep 1974641
- 1974641: Fix tab completion with multiple optional commands

# subscription-manager syspurpose role --list -h
usage: subscription-manager syspurpose role [OPTIONS]

Show or modify the system purpose role setting

optional arguments:
  -h, --help            show this help message and exit
  --proxy PROXY_URL     proxy URL in the form of hostname:port
  --proxyuser PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --noproxy NO_PROXY    host suffixes that should bypass HTTP proxy
  --username USERNAME   username to use when authorizing against the server
  --password PASSWORD   password to use when authorizing against the server
  --token TOKEN         token to use when authorizing against the server
  --org ORG_KEY         specify an organization
  --set SET             set role of system purpose
  --unset               unset role of system purpose
  --show                show this system's current role
  --list                list all role available

# subscription-manager syspurpose role --list --
--help           --password       --set            --username
--list           --proxy          --show           
--noproxy        --proxypassword  --token          
--org            --proxyuser      --unset          

# subscription-manager syspurpose usage --
--help           --password       --set            --username
--list           --proxy          --show           
--noproxy        --proxypassword  --token          
--org            --proxyuser      --unset          

# subscription-manager syspurpose usage --username --
--help           --password       --set            --username
--list           --proxy          --show           
--noproxy        --proxypassword  --token          
--org            --proxyuser      --unset          

# subscription-manager syspurpose service-level --
--help           --list           --org            --proxy          --proxyuser      --set            --token          --username
--insecure       --noproxy        --password       --proxypassword  --serverurl      --show           --unset     

All options now appear in tab completion, Moving the bug to verified!!

Comment 8 errata-xmlrpc 2022-05-17 15:58:13 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 (new packages: subscription-manager), 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://access.redhat.com/errata/RHBA-2022:3984


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