Bug 1350402 - Bad error message is displayed when --file option missed an argument
Summary: Bad error message is displayed when --file option missed an argument
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jiri Hnidek
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-27 10:58 UTC by Rehana
Modified: 2018-04-10 09:48 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.20.2-1
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-04-10 09:47:31 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0681 None None None 2018-04-10 09:48:38 UTC
Github candlepin subscription-manager pull 1656 None None None 2017-06-08 11:47:41 UTC
Red Hat Bugzilla 1462449 None None None Never
Red Hat Bugzilla 1462456 None None None Never

Internal Links: 1462449 1462456

Description Rehana 2016-06-27 10:58:39 UTC
Description of problem:
Observed that a bad error message was displayed on the console when --file option missed argument while reading pool ids from stdin

Version-Release number of selected component (if applicable):
subscription-manager: 1.17.8-1.el7
python-rhsm: 1.17.4-1.el7


How reproducible:
3/3

Steps to Reproduce:
1.Register test machine to candlepin 
2.Execute `# subscription-manager list --available --match-installed --pool-only | subscription-manager attach --file` ( with out hyphen to read from stdin)
3.

Actual results:
=============
Observed

# subscription-manager list --available --match-installed --pool-only | subscription-manager attach --file 
Usage: subscription-manager attach [OPTIONS]

subscription-manager: error: --file option requires an argument
close failed in file object destructor:   << ==== Bad errors 
sys.excepthook is missing
lost sys.stderr


Expected results:
====================
Should only display 
"Usage: subscription-manager attach [OPTIONS]

subscription-manager: error: --file option requires an argument"

Additional info:

The above mentioned issue is only reproducible before a successful attach by reading pool id from stdin 

# subscription-manager list --available --match-installed --pool-only | subscription-manager attach --file -
Successfully attached a subscription for: Red Hat Enterprise Linux ES (Basic)
Successfully attached a subscription for: Red Hat Enterprise Linux ES (Basic)

# subscription-manager list --available --match-installed --pool-only | subscription-manager attach --file 
Usage: subscription-manager attach [OPTIONS]

subscription-manager: error: --file option requires an argument

^^ now the other messages are not displayed

Comment 3 Shwetha Kallesh 2017-11-10 08:34:23 UTC
Verified!

[root@dhcp35-121 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.2.0-1
subscription management rules: 5.26
subscription-manager: 1.20.5-1.el7
python-rhsm: 0.0.0-1


[root@dhcp35-121 ~]# subscription-manager register
Registering to: F21-candlepin.usersys.redhat.com:8443/candlepin
Username: admin
Password: 
Organization: admin
The system has been registered with ID: d9951332-159b-47b4-9050-55707a51f126
The registered system name is: dhcp35-121.lab.eng.blr.redhat.com


[root@dhcp35-121 ~]# subscription-manager list --available --match-installed --pool-only | subscription-manager attach --file
Usage: subscription-manager attach [OPTIONS]

subscription-manager: error: --file option requires an argument

Comment 6 errata-xmlrpc 2018-04-10 09:47:31 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-2018:0681


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