Bug 1584527 - RFE: Easier debugging of invalid entitlement certificates
Summary: RFE: Easier debugging of invalid entitlement certificates
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.0.4
: 3.0.x
Assignee: RHUI Bug List
QA Contact: Vratislav Hutsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-31 07:10 UTC by Radek Bíba
Modified: 2018-07-10 16:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-10 16:00:36 UTC
Target Upstream Version:
Embargoed:


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 2018-05-31 07:10:54 UTC
Description of problem:
When you try to upload an invalid certificate, rhui-manager only provides the following error message:

The given certificate contains one or more entitlements that are
not compatible with the RHUI. For questions, please visit:
https://access.redhat.com/support/contact/customerService.html

User experience would be much better, and troubleshooting could start more efficiently, if the error message included the entitlement that wasn't compatible.

While trying to understand the recent issue brought up by Tapomoy, I (also) made the following change to /usr/lib/python2.7/site-packages/rhui/tools/cert_manager.py to force the responsible method to tell me which URL failed to validate against the predefined pattern, instead of just returning True/False:

def _is_valid_download_url(download_url):
<snip>
#    return fnmatch.fnmatch(download_url, VALID_URL_PATTERN)
    if fnmatch.fnmatch(download_url, VALID_URL_PATTERN):
        return True
    else:
        print download_url
        return False

The next attempt to upload the questionable pem file then produced:

# rhui-manager cert upload --cert /tmp/4361937509242360488.pem 
/content/eus/rhel/server/7/$releasever/$basearch/sap/os
The given certificate contains one or more entitlements that are
not compatible with the RHUI. For questions, please visit:
https://access.redhat.com/support/contact/customerService.html

Sure enough, it's not neat at all, but it helps. Please modify the code as appropriate to make rhui-manager explain -- print/log -- nicely which (first) entitlement is incompatible.

Version-Release number of selected component (if applicable):
rh-rhui-tools-3.0.3-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.