Bug 1441397

Summary: bash completion for all subscription-manager modules is failing to present the new "--noproxy" option
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: low    
Version: 7.4CC: csnyder, jhnidek, khowell, redakkan, skallesh
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.19.18-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 19:22:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Sefler 2017-04-11 21:01:55 UTC
Description of problem:
Recently added to the command line options for most all subscription-manager modules is a new option called "--noproxy".  This was added by the fix for bug 1420533..
https://github.com/candlepin/subscription-manager/pull/1551

The new "--noproxy" is currently failing to bash complete (also known as tab completion).


Version-Release number of selected component (if applicable):
[root@jsefler-rhel7 ~]# rpm -q subscription-manager python-rhsm bash-completion
subscription-manager-1.19.6-1.git.4.8a8fb32.el7.x86_64
python-rhsm-1.19.4-1.git.0.8a8fb32.el7.x86_64
bash-completion-2.1-6.el7.noarch


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel7 ~]# subscription-manager unregister --help
Usage: subscription-manager unregister [OPTIONS]

Unregister this system from the Customer Portal or another subscription
management service

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
  --noproxy=NO_PROXY    host suffixes that should bypass HTTP proxy


[root@jsefler-rhel7 ~]# subscription-manager unregister --<TAB><TAB>
-h               --proxy          --proxyuser
--help           --proxypassword  


Actual results:
Observe that the help for the unregister module includes the new "--noproxy" option.  However when trying to tab complete on the command line, the "--noproxy" option is not presented as an option.
-h               --proxy          --proxyuser
--help           --proxypassword  

Expected results:
-h               --proxy          --proxyuser
--help           --proxypassword  --noproxy


Additional info:

Comment 2 John Sefler 2017-04-11 21:23:03 UTC
bash completion of --noproxy is also failing for "rhsm-debug system"....

[root@jsefler-rhel7 ~]# rhsm-debug system --help
Usage: rhsm-debug system [OPTIONS] 

Assemble system information as a tar file or directory

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
  --noproxy=NO_PROXY    host suffixes that should bypass HTTP proxy
  --destination=DESTINATION
                        the destination location of the result; default is
                        /tmp
  --no-archive          data will be in an uncompressed directory
  --sos                 only data not already included in sos report will be
                        collected

[root@jsefler-rhel7 ~]# rhsm-debug system --<TAB><TAB>
--destination    --no-archive     --proxypassword  --sos            
--help           --proxy          --proxyuser      


Actual Results:
above

Expected Results:
--destination    --no-archive     --proxypassword  --sos            
--help           --proxy          --proxyuser      --noproxy

Comment 4 Rehana 2017-05-31 10:14:20 UTC
Reproducing the failure:
=======================
subscription-manager: 1.19.15-1.el7
python-rhsm: 1.19.6-1.el7

[root@ibm-x3250m3-01 ~]# subscription-manager unregister --
--help           --proxy          --proxypassword  --proxyuser    


Verifying the on latest subscripton-manager build:
==================================================

# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.1.1-1
subscription management rules: 5.23
subscription-manager: 1.19.17-1.el7
python-rhsm: 1.19.8-1.el7


# subscription-manager unregister --
--help           --noproxy        --proxy          --proxypassword  --proxyuser   

^^ --noproxy is listed for tab completion . however rhsm-debug (issue mentioned in comment 2 ) is still not fixed 

[root@dhcp151-206 ~]# rhsm-debug system --
--destination    --help           --no-archive     --proxy          --proxypassword  --proxyuser      --sos  

Moving back to "New" to fix the rhsm-debug tab completion for --noproxy option

Comment 5 Chris Snyder 2017-05-31 20:04:30 UTC
Merged the second PR. This should fix the failure.
Moving to MODIFIED.

Comment 7 Shwetha Kallesh 2017-06-07 07:16:51 UTC
Dont see bash completion for rhsm-debug with follwoing version , so moving bug back to new

[root@dhcp35-135 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.33-1
subscription management rules: 5.23
subscription-manager: 1.19.17-1.el7
python-rhsm: 1.19.8-1.el7


[root@dhcp35-135 ~]# rhsm-debug system --
--destination    --help           --no-archive     --proxy          --proxypassword  --proxyuser      --sos

Comment 9 Rehana 2017-06-08 10:28:51 UTC
Verifying on:
=============

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.1.1-1
subscription management rules: 5.23
subscription-manager: 1.19.18-1.el7
python-rhsm: 1.19.9-1.el7

# rhsm-debug system --<TAB> <TAB>
--destination    --help           --no-archive     --noproxy        --proxy          --proxypassword  --proxyuser      --sos            

# rhsm-debug system --no<TAB>
--no-archive  --noproxy     

Observed that now the bash completion for --noproxy works on rhsm-debug command. 

Moving this bug to Verified.

Comment 10 errata-xmlrpc 2017-08-01 19:22:43 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://access.redhat.com/errata/RHBA-2017:2083