Bug 703110 - "AttributeError:" while uploading a new content certificate using rhui-manager commands
Summary: "AttributeError:" while uploading a new content certificate using rhui-manage...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-09 10:19 UTC by Sachin Ghai
Modified: 2012-05-31 12:51 UTC (History)
1 user (show)

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


Attachments (Terms of Use)

Description Sachin Ghai 2011-05-09 10:19:40 UTC
Description of problem:
Uploading a new content certificate using rhui-manager command throws a traceback:

[root@dhcp193-136 content-cert]# rhui-manager  cert upload --cert /root/content-cert/content-cert.crt  --key /root/content-cert/content-key.pem 
Traceback (most recent call last):
  File "/usr/bin/rhui-manager", line 16, in <module>
    rhui.tools.launcher.main()
  File "/usr/lib/python2.6/site-packages/rhui/tools/launcher.py", line 337, in main
    cli.run(args)
  File "/usr/lib/python2.6/site-packages/rhui/common/cli.py", line 275, in run
    command_or_section.execute(remaining_args)
  File "/usr/lib/python2.6/site-packages/rhui/common/cli.py", line 116, in execute
    self.method(**arg_dict)
  File "/usr/lib/python2.6/site-packages/rhui/tools/commands/cert.py", line 46, in upload
    if not content_cert.can_update_cert(self.config):
AttributeError: 'module' object has no attribute 'can_update_cert'


Version-Release number of selected component (if applicable):
pulp 0.171
rhui-toosl 2.0.22

How reproducible:
always

Steps to Reproduce:
1. # rhui-manager  cert upload --cert /root/content-cert/content-cert.crt  --key /root/content-cert/content-key.pem 
2.
3.
  
Actual results:
AttributeError: 'module' object has no attribute 'can_update_cert'

Expected results:
Content certificate should uploaded successfully

Additional info:
I used the same certs to update the content certs using rhui-tools. and I was able to upload them successfully.


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


-= Entitlements Manager =-

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

                                         Connected: dhcp193-157.pnq.redhat.com
------------------------------------------------------------------------------
rhui (entitlements) => u

Full path to the new content certificate:
/root/content-cert/content-cert.crt

Full path to the new content certificate private key:
/root/content-cert/content-key.pem 

The RHUI will be updated with the following certificate:
  Certificate: /root/content-cert/content-cert.crt
  Key:         /root/content-cert/content-key.pem

Proceed? (y/n) y

Backing up certificate to /etc/pki/rhui/bak-content-cert.crt...
Updating RHUI Tools...
... certificate successfully updated
Updating repository Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)...
... successfully updated
Updating repository Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)...
... successfully updated

Red Hat Content Certificate

  General
    Not Before:    2011-03-29 13:59:28+00:00
    Not After:     2011-06-25 13:59:28+00:00
    Serial Number: 90

  Entitlements
    Red Hat Enterprise Linux Server (RPMs)
    Red Hat Enterprise Linux Server (SRPMS)
    Red Hat Enterprise Linux Server (STS)
    Red Hat Enterprise Linux Server 6 Optional Releases (RPMs)
    Red Hat Enterprise Linux Server 6 Optional Releases (SRPMS)
    Red Hat Enterprise Linux Server 6 Optional Updates (RPMs)
    Red Hat Enterprise Linux Server 6 Optional Updates (SRPMS)
    Red Hat Enterprise Linux Server 6 Releases (RPMs)
    Red Hat Enterprise Linux Server 6 Releases (SRPMS)
    Red Hat Enterprise Linux Server 6 Updates (RPMs)
    Red Hat Enterprise Linux Server 6 Updates (SRPMS)
    Red Hat Update Infrastructure 1.2 (RPMs)
    Red Hat Update Infrastructure 1.2 (SRPMS)

------------------------------------------------------------------------------
rhui (entitlements) =>

Comment 1 Jay Dobies 2011-05-09 19:24:50 UTC
commit ceb7b02fd6ebfbfb9d577b4f06e6e60bd87bd280
Author: Jay Dobies <jason.dobies>
Date:   Mon May 9 15:22:26 2011 -0400

    703110 - Changed incorrect access control checks

rhui-2.0/tools/src/rhui/tools/commands/cert.py

Comment 2 Jay Dobies 2011-05-24 12:11:25 UTC
Fixed in 2.0.23.

Comment 3 Sachin Ghai 2011-05-25 07:54:03 UTC
Verified in:

rhui-tools: 2.0.25
pulp 0.179

I can upload new content certs using cli withou any error. 

Logs:
===
 [root@dhcp193-136 rhui_certs]# rhui-manager cert upload --cert /root/rhui_certs/rhui-amazon-20101109.crt --key /root/rhui_certs/rhui-amazon-20101109.key
Previous authentication credentials could not be found. Logging into
the RHUI.

If this is the first time using the RHUI, it is recommended to change
the user's password in the User Management section of RHUI Tools.

RHUI Username: admin
RHUI Password: 
Backing up certificate to /etc/pki/rhui/bak-content-cert.crt...
Updating RHUI Tools...
... certificate successfully updated
Updating repository Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)...
... successfully updated
Updating repository Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)...
... successfully updated
Updating repository Red Hat Update Infrastructure 1.1 (RPMs) (5Server-x86_64)...
... successfully updated
Updating repository Red Hat Update Infrastructure 1.1 (RPMs) (5Server-i386)...
... successfully updated
Updating repository Red Hat Enterprise Linux Server 6 Updates (RPMs) (6Server-x86_64)...
... successfully updated
Updating repository Red Hat Enterprise Linux Server 6 Releases (RPMs) (6Server-x86_64)...
... successfully updated
Red Hat Content Certificate

  General
    Not Before:    2010-11-10 16:13:35+00:00
    Not After:     2011-11-09 16:13:35+00:00
    Serial Number: 69

  Entitlements
    Red Hat Enterprise Linux Server (RPMs)
    Red Hat Enterprise Linux Server 6 Releases (RPMs)
    Red Hat Enterprise Linux Server 6 Updates (RPMs)
    Red Hat Update Infrastructure 1.1 (RPMs)
    Red Hat Update Infrastructure 1.2 (RPMs)

[root@dhcp193-136 rhui_certs]# rpm -qa | grep rhui
rh-rhui-tools-2.0.25-1.el6.noarch
[root@dhcp193-136 rhui_certs]# rpm -qa | grep pulp
pulp-common-0.0.179-1.el6.noarch
pulp-client-0.0.179-1.el6.noarch
[root@dhcp193-136 rhui_certs]#

Comment 4 wes hayutin 2011-08-01 21:38:29 UTC
moving to release pending

Comment 5 wes hayutin 2012-05-31 12:51:18 UTC
closing out, product released


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