Bug 716966 - multi content cert, fails to add a new repo , if one of the content cert is expired
Summary: multi content cert, fails to add a new repo , if one of the content cert is e...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: rhui-20
TreeView+ depends on / blocked
 
Reported: 2011-06-27 15:26 UTC by Kedar Bidarkar
Modified: 2012-05-31 12:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-31 12:56:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Kedar Bidarkar 2011-06-27 15:26:59 UTC
Description of problem:

when working with multi content cert, if one of the cert expires, does not add 
any further repos.


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Management =-

   l   list repositories currently managed by the RHUI
   i   display detailed information on a repository
   a   add a new Red Hat content repository
   c   create a new custom repository
   d   delete a repository from the RHUI
   u   upload content to a custom repository
   p   list packages in a repository

                                      Connected: ip-10-122-70-115.ec2.internal
------------------------------------------------------------------------------
rhui (repo) => a

Loading latest entitled products from Red Hat...

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Management =-


[root@ip-10-122-70-115 noarch]# cat /root/.rhui/rhui.log
Connecting to RHUA [ip-10-122-70-115.ec2.internal]...
Successfully connected to [ip-10-122-70-115.ec2.internal]
Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 75, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 94, in listen
    Shell.listen(self)
  File "/usr/lib/python2.6/site-packages/rhui/common/shell.py", line 191, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/repo.py", line 122, in add
    self.candidate_repo_manager.translate_entitlements()
  File "/usr/lib/python2.6/site-packages/rhui/tools/repo_candidates.py", line 62, in translate_entitlements
    mappings = self.cdn_api.expand_variables(e.download_url, cert.cert_filename)
  File "/usr/lib/python2.6/site-packages/rhui/tools/cdn_api.py", line 70, in expand_variables
    mappings = self._translate_next_variable({'' : url}, cert_filename)
  File "/usr/lib/python2.6/site-packages/rhui/tools/cdn_api.py", line 104, in _translate_next_variable
    substitutions = self._request_get(listing_url, cert_filename).split('\n')[:-1]
  File "/usr/lib/python2.6/site-packages/rhui/tools/cdn_api.py", line 155, in _request_get
    raise Exception(response.status, response.read())
Exception: (403, '<HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD><BODY>\n<H1>Access Denied</H1>\n \nYou don\'t have permission to access "http&#58;&#47;&#47;cdn&#46;redhat&#46;com&#47;content&#47;dist&#47;rhel&#47;rhui&#47;server&#45;6&#47;releases&#47;listing" on this server.<P>\nReference&#32;&#35;18&#46;df38fa8&#46;1309187058&#46;1ff7961\n</BODY>\n</HTML>\n')


Version-Release number of selected component (if applicable):
pulp-194, rhui - 2.0.32

How reproducible:

Adding a repo to rhua, fails if one content cert is expired.

Steps to Reproduce:
1.
2.
3.
  
Actual results:
fails to add a repo , from the new content cert.

Expected results:

Should allow, to add repo's from the new content cert, when the old/current content cert is already expired.


Additional info:

OLD content cert , VALIDITY

[root@ip-10-122-70-115 gen_certs]# openssl x509 -in rhui-content.pem -noout -text | grep -A 2 -i "validity"
        Validity
            Not Before: Mar 29 13:59:28 2011 GMT
            Not After : Jun 25 13:59:28 2011 GMT

NEW content cert, VALIDITY

[root@ip-10-122-70-115 gen_certs]# openssl x509 -in rhui-combo.pem -noout -text | grep -A 2 -i "validity"
        Validity
            Not Before: Nov 10 16:13:35 2010 GMT
            Not After : Nov  9 16:13:35 2011 GMT

Comment 1 Jay Dobies 2011-07-08 14:15:56 UTC
commit 9151128ed1f7683c4fa66558554f88e20f012254
Author: Jay Dobies <jason.dobies>
Date:   Fri Jul 8 10:13:30 2011 -0400

    716966 - Cert manager is now aware of valid v. expired certificates.
    RHUI Manager will now only work with valid certificates for things like
    new repos or client entitlement certificates. Expired certificates are
    shown in the entitlements list.

rhui-2.0/tools/src/rhui/tools/cert_manager.py
rhui-2.0/tools/src/rhui/tools/content_cert.py
rhui-2.0/tools/src/rhui/tools/repo_candidates.py
rhui-2.0/tools/src/rhui/tools/screens/client.py

Comment 2 Jay Dobies 2011-07-08 14:23:15 UTC
Filed a docs bug with the new screenshot (719960).

The behavior now is that when adding new repos or creating client entitlement certificates, only valid entitlements are accessible. The only place to even know expired entitlements exist is in the Entitlements Manager screen.

From that screen, selecting to list the entitlements should show:

- Valid section - Always shown; if none are valid, will contain a message indicating that.

- Expired section - Only shown if there are one or more expired entitlements.

Comment 3 Jay Dobies 2011-07-08 17:43:27 UTC
Fixed in 2.0.36.

Comment 4 Kedar Bidarkar 2011-07-11 06:03:41 UTC
Yes, we have a Valid and Expired Section 

When using an expired cert.

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Entitlements Manager =-

   l   list Red Hat content certificate entitlements
   c   list custom repository entitlements
   u   upload a new or updated Red Hat content certificate

                                      Connected: ip-10-88-107-123.ec2.internal
------------------------------------------------------------------------------
rhui (entitlements) => u

Full path to the new content certificate:
/root/gen_certs/rhui-content.pem

The RHUI will be updated with the following certificate:
  /root/gen_certs/rhui-content.pem

Proceed? (y/n) y


Red Hat Entitlements

  Valid
    No valid entitlements found.

  Expired
    Red Hat Enterprise Linux Server (RPMs)
    Expiration: 06-25-2011     Certificate: rhui-content.pem

    Red Hat Enterprise Linux Server 6 Releases (RPMs)
    Expiration: 06-25-2011     Certificate: rhui-content.pem

                     ..... removed content on purpose

    Red Hat Enterprise Linux Server 6 Updates (RPMs)
    Expiration: 06-25-2011     Certificate: rhui-content.pem

    Red Hat Update Infrastructure 1.2 (RPMs)
    Expiration: 06-25-2011     Certificate: rhui-content.pem

    Red Hat Update Infrastructure 1.2 (SRPMS)
    Expiration: 06-25-2011     Certificate: rhui-content.pem


------------------------------------------------------------------------------

When using a new active content certs.

rhui (entitlements) => u

Full path to the new content certificate:
/root/gen_certs/rhui-amazon-2011.pem

The RHUI will be updated with the following certificate:
  /root/gen_certs/rhui-amazon-2011.pem

Proceed? (y/n) y


Red Hat Entitlements

  Valid
    Red Hat Enterprise Linux Server (Beta RPMs)
    Expiration: 03-21-2012     Certificate: rhui-amazon-2011.pem

    Red Hat Enterprise Linux Server (RPMs)
    Expiration: 03-21-2012     Certificate: rhui-amazon-2011.pem

    Red Hat Enterprise Linux Server (SRPMS)
    Expiration: 03-21-2012     Certificate: rhui-amazon-2011.pem

    Red Hat Enterprise Linux Server (STS)
    Expiration: 03-21-2012     Certificate: rhui-amazon-2011.pem

               ......  removed content on purpose

    Red Hat Update Infrastructure x86_64 Beta Optional (RPMs)
    Expiration: 03-21-2012     Certificate: rhui-amazon-2011.pem

  Expired
    Red Hat Update Infrastructure 1.2 (SRPMS)
    Expiration: 06-25-2011     Certificate: rhui-content.pem


And also we get the options menu now, after adding new active content cert.

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Management =-

   l   list repositories currently managed by the RHUI
   i   display detailed information on a repository
   a   add a new Red Hat content repository
   c   create a new custom repository
   d   delete a repository from the RHUI
   u   upload content to a custom repository
   p   list packages in a repository

                                      Connected: ip-10-88-107-123.ec2.internal
------------------------------------------------------------------------------
rhui (repo) => a

Loading latest entitled products from Red Hat...
... listings loaded
Determining undeployed products...
... product list calculated

Import Repositories:
  1  - All in Certificate
  2  - By Product
  3  - By Repository
Enter value (1-3) or 'b' to abort: 3



Also, after updating the new active content certs, we are able to add content repos and sync.

Comment 5 wes hayutin 2011-08-01 21:40:15 UTC
moving to release pending

Comment 6 wes hayutin 2012-05-31 12:56:08 UTC
closing out, product released


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