Bug 857866 - Index out of range creating entitlement certificate for a custom repository
Summary: Index out of range creating entitlement certificate for a custom repository
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: RHUA
Version: 2.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: mkovacik
QA Contact: mkovacik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-17 10:02 UTC by mkovacik
Modified: 2012-09-28 14:38 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When creating entitlement certificate for custom protected repositories that share the same entitlement path, an "index out of range" error occurs. This fix corrects the client.py script so that creating entitlements for custom protected repositories works without error.
Clone Of:
Environment:
Last Closed: 2012-09-28 14:38:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screen log (15.20 KB, text/plain)
2012-09-17 10:02 UTC, mkovacik
no flags Details
Screen log 1 (37.41 KB, text/plain)
2012-09-17 12:08 UTC, mkovacik
no flags Details
RHUI update log (158.84 KB, text/plain)
2012-09-27 07:14 UTC, mkovacik
no flags Details
Verifying screen log (44.91 KB, text/plain)
2012-09-27 07:17 UTC, mkovacik
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:1315 0 normal SHIPPED_LIVE Red Hat Update Infrastructure 2.1 bug fix update 2012-09-28 18:37:47 UTC

Description mkovacik 2012-09-17 10:02:23 UTC
Created attachment 613620 [details]
Screen log

Description of problem:
An "Index out of range" exception is risen while creating entitlement certificate for a custom repository 

Version-Release number of selected component (if applicable):
RHUI 2.1;  RHEL-6.3-RHUI-2.1-20120815.0-Server-x86_64-DVD1.iso

How reproducible:
2 of 2

Steps to Reproduce:
0. deploy rhui 2.1 with a cds cluster: cluster-1
1. create several custom protected repositories
2. associate them with a cluster-1
3. generate entitlement certificate for a (last-one) custom repository
4. the exception happens 
  
Actual results:
An "index out of range" exception prevents creating custom protected repository entitlement certificate

Expected results:
Creating entitlements for custom protected repositories works OK

Additional info:
See the screen log attached for more details

Comment 1 mkovacik 2012-09-17 12:08:24 UTC
Created attachment 613646 [details]
Screen log 1

It seems first few custom protected repositories are handled OK; see in Screen log 1...

Comment 2 James Slagle 2012-09-18 17:59:20 UTC
The bug is triggered when you have multiple custom repos that share the same entitlement path.

The fix as pointed out by Ian Pilcher is relatively straightforward:
/home/jslagle/code/cloude/rhui-2.0/tools $ git diff
diff --git a/rhui-2.0/tools/src/rhui/tools/screens/client.py b/rhui-2.0/tools/sr
index 448188d..ad52f25 100644
--- a/rhui-2.0/tools/src/rhui/tools/screens/client.py
+++ b/rhui-2.0/tools/src/rhui/tools/screens/client.py
@@ -93,7 +93,7 @@ class ClientScreen(Screen):
                     continue
                 menu_item += '             %s\n' % repo['name']
 
-                custom_ent_names.append(menu_item)
+            custom_ent_names.append(menu_item)
 
         if not (redhat_ent_names or custom_ent_names):
             self.prompt.write('Cluster is not associated with any '

I've committed this to the cloude repo:
e23b3456aebceb0a3b3086b6ed0d6feeff33f3a1

Comment 3 James Slagle 2012-09-20 11:14:52 UTC
QA:
make sure you've updated to rh-rhui-tools-2.1.11.  Follow the RHUI update procedure as outlined in the RHUI Administration guide to get the updated package, however, sync your RHUI repos from cdn.rcm-qa.redhat.com instead of cdn.redhat.com in order to get this updated package.

Once the package has been updated, here are sample verification steps (you may like to add more):

1. restart rhui-manager if it was already running before the update
2. create multiple custom repos, at least 2 need to share the same entitlement path
3. create entitlement certs for the custom repos.  ensure all custom repos can be used to create entitlement certs.  Probably a good idea to test selecting one custom repo at a time, then all custom repos at a time, then various cherry picked ones, etc.

Comment 5 James Slagle 2012-09-25 15:42:08 UTC
built into rh-rhui-tools-2.1.13-1.el6_3, make sure you have this version when testing the update instead of the previously mentioned rh-rhui-tools-2.1.11 in comment 3

Comment 6 mkovacik 2012-09-27 07:14:48 UTC
Created attachment 617920 [details]
RHUI update log

Update to rh-rhui-tools-2.1.13-1.el6_3 successful

Comment 7 mkovacik 2012-09-27 07:17:49 UTC
Created attachment 617921 [details]
Verifying screen log

The up-to-date package rh-rhui-tools-2.1.13-1.el6_3 solves the issue. See the screen log attached.

Notes:
- rh-rhui-tools-2.1.13-1.el6_3.noarch.rpm is not yet signed
- test performed in EC2 staging env

Comment 9 errata-xmlrpc 2012-09-28 14:38:26 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-2012-1315.html


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