Bug 748912

Summary: subscription-manager-gui tracebacks when importing non-existant cert
Product: Red Hat Enterprise Linux 6 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: John Sefler <jsefler>
Status: CLOSED ERRATA QA Contact: J.C. Molet <jmolet>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: bkearney
Target Milestone: beta   
Target Release: 6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:53:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 771481    
Attachments:
Description Flags
The following certificate files did not exist: none

Description J.C. Molet 2011-10-25 14:44:50 UTC
Description of problem:
A traceback is caused in the rhsm-gui when you try to import a cert that doesn't exist, giving the wrong error message.

Version-Release number of selected component (if applicable):
subscription-manager-gnome-0.96.16-1.git.3.ed5f117.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.  Start up subscritpion-manager-gui
2.  Click on 'Import Certificate'
3.  Click to enter a Certificate Location
4.  In the filepath text entry, enter in a file that doesn't exist, ie: "/tmp/doesnotexistblahblah.pem", and click 'Open'
5.  Click 'Import Certificate'
  
Actual results:
**You get a traceback:

2011-10-25 10:31:07,309 [ERROR]  @importsub.py:85 - [Errno 2] No such file or directory: '/tmp/blahblah.txt'
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/gui/importsub.py", line 71, in _import_button_clicked
    extractor = ImportFileExtractor(src_cert_file)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 597, in __init__
    content = self._read(cert_file_path)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 601, in _read
    fd = open(file_path, "r")
IOError: [Errno 2] No such file or directory: '/tmp/blahblah.txt'


**You get an error pop up saying:

An error occurred while importing the certificate. Please check log file for more information.

**You can click the import certificate button again to repeat the error.

Expected results:
**No traceback.
**Error message would say something like:  File does not exist.  Please choose again.
**The file path variable would be reset to None so that when you clicked Import Certificate again, you would get the error:  "Please choose a certificate."  like you would if you had never chosen a certificate (essentially resetting the dialog to the beginning)

Additional info:
occurs on all versions of rhsm.

Comment 3 RHEL Program Management 2012-07-10 07:57:32 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2012-07-11 02:08:12 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 5 Bryan Kearney 2012-10-22 19:31:22 UTC
fixed in master at 7154094dd9e67399fe033bd236c98c2bccc0c302.

Comment 7 John Sefler 2012-11-17 19:08:02 UTC
Created attachment 646924 [details]
The following certificate files did not exist:

Verifying Version:
[root@jsefler-6 ~]# rpm -q subscription-manager subscription-manager-gui
subscription-manager-1.1.9-1.el6.x86_64
subscription-manager-gui-1.1.9-1.el6.x86_64

[root@jsefler-6 ~]# subscription-manager import --certificate=/tmp/doesnotexistblahblah.pem
doesnotexistblahblah.pem is not a valid certificate file. Please use a valid certificate.

^^^^ FROM THE CLI, THE FEEDBACK IS NOT EXACTLY THE SAME AS THE GUI, BUT THERE IS NO TRACEBACK AND IT IS TRUE THAT THE NOT EXISTENT CERTIFICATE IS NOT A VALID FILE.


Moving to VERIFIED

Comment 9 errata-xmlrpc 2013-02-21 08:53:39 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.

http://rhn.redhat.com/errata/RHBA-2013-0350.html