Bug 857866 - Index out of range creating entitlement certificate for a custom repository
Index out of range creating entitlement certificate for a custom repository
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: RHUA (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: mkovacik
Depends On:
  Show dependency treegraph
Reported: 2012-09-17 06:02 EDT by mkovacik
Modified: 2012-09-28 10:38 EDT (History)
3 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Last Closed: 2012-09-28 10:38:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description mkovacik 2012-09-17 06:02:23 EDT
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 08:08:24 EDT
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 13:59:20 EDT
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):
                 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:
Comment 3 James Slagle 2012-09-20 07:14:52 EDT
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 11:42:08 EDT
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 03:14:48 EDT
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 03:17:49 EDT
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.

- 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 10:38:26 EDT
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.


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