Bug 1519862 - rhui-manager cert upload (CLI) doesn't handle an expired certificate well [NEEDINFO]
Summary: rhui-manager cert upload (CLI) doesn't handle an expired certificate well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.0.4
: 3.0.x
Assignee: Martin Minar
QA Contact: Vratislav Hutsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-01 15:01 UTC by Radek Bíba
Modified: 2019-11-12 02:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-10 16:00:36 UTC
Target Upstream Version:
Embargoed:
mminar: needinfo?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2153 0 None None None 2018-07-10 16:00:57 UTC

Description Radek Bíba 2017-12-01 15:01:23 UTC
Description of problem:
When I try uploading an expired certificate in the interactive mode, I get this proper error message:

The provided certificate is expired or invalid.  Please upload a valid one

I'd expect a similar response in the CLI, but here's what actually happens:

[root@rhua ~]# rhui-manager cert upload --cert shortlivedcert.pem 

An unexpected error has occurred during the last operation.


[root@rhua ~]#

When I look at the end of /root/.rhui/rhui.log, I find this:

2017-12-01 14:54:54,516 - Connecting to RHUA [rhua.example.com]...
2017-12-01 14:54:54,520 - Successfully connected to [rhua.example.com]
2017-12-01 14:54:54,522 - This certificate is invalid or expired.
None
2017-12-01 14:54:54,522 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/cli.py", line 66, in run
    Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 272, in run
    command_or_section.execute(remaining_args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 113, in execute
    self.method(**arg_dict)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 57, in upload
    self._upload_cert(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 101, in _upload_cert
    self.cert_manager.add_certificate(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/cert_manager.py", line 273, in add_certificate
    raise InvalidOrExpiredCertificate()
InvalidOrExpiredCertificate
2017-12-01 14:54:54,523 - 
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/cli.py", line 66, in run
    Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 272, in run
    command_or_section.execute(remaining_args)
  File "/usr/lib/python2.7/site-packages/rhui/common/cli.py", line 113, in execute
    self.method(**arg_dict)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 57, in upload
    self._upload_cert(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/commands/cert.py", line 101, in _upload_cert
    self.cert_manager.add_certificate(valid_cert_filename)
  File "/usr/lib/python2.7/site-packages/rhui/tools/cert_manager.py", line 273, in add_certificate
    raise InvalidOrExpiredCertificate()
InvalidOrExpiredCertificate

But I only look there because I already know where to look. Please allow the CLI to print an error message that says it all, or at lease add the location of this log file to the current error message (such as Please check ~/.rhui/rhui.log for more details.)

Version-Release number of selected component (if applicable):
rh-rhui-tools-3.0.1-3.el7ui.noarch

Comment 7 errata-xmlrpc 2018-07-10 16:00:36 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:2153


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