Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1350402

Summary: Bad error message is displayed when --file option missed an argument
Product: Red Hat Enterprise Linux 7 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: low    
Version: 7.3CC: jhnidek, khowell, redakkan, skallesh, vrjain
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.20.2-1 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:47:31 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 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