Bug 566434

Summary: system.addEntitlements call fails with "Invalid entitlement" on given right entitlement
Product: Red Hat Satellite 5 Reporter: Garik Khachikyan <gkhachik>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED ERRATA QA Contact: Garik Khachikyan <gkhachik>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, mkoci
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-03 14:18:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 518263    

Description Garik Khachikyan 2010-02-18 13:48:08 UTC
Description of problem:
Through Satellite UI make a system unentitled (remove the Management system entitlement from it). 
Then call:
server.system.addEntitlements(session,systemid, ['enterprise_entitled'])

Version-Release number of selected component (if applicable):


How reproducible:
always


Steps to Reproduce:
1. described in problem description above
2.
3.
  
Actual results:
throws an exception: 
<Fault -212: 'redstone.xmlrpc.XmlRpcFault: Invalid entitlement'>

Expected results:
Should pass ok, system should get entitled

Additional info:

Comment 1 Tomas Lestach 2010-02-18 15:39:38 UTC
system.removeEntitlements and system.addEntitlements API calls are not meant for removing and adding Management entitlement ('enterprise_entitled').

For setting/removing this entitlement you can use system.setDetails API call (check base_entitlement).

However, it would be possible to extent the usage of the system.add/removeEntitlements so they would handle also the Management entitlement.

Cliff, what do you think?

Comment 2 Clifford Perry 2010-02-18 15:45:35 UTC
go ahead and do this :) 

I feel allowing these two API calls to also set Management makes sense. 

So folks do not have to go digging for it. 

Cliff

Comment 3 Tomas Lestach 2010-02-19 13:00:16 UTC
I enabled handling of base entitlements using system.add/removeEntitlements API calls

spacewalk.git: 5e5888b9c1d321354a30cbd5ed320044c29b1ffb

Comment 4 Tomas Lestach 2010-02-19 15:33:29 UTC
satellite.git: d02c959c3f12adfdf3dcd74a96bf4ecf4d0e3e06

Comment 7 Garik Khachikyan 2010-02-22 15:25:20 UTC
# VERIFIED

Thanks to Tomas we have now add/removeEntitlements for 'enterprise_entitled' working as well as for other system entitlements.

Checked against Satellite installed on RHEL 4 AS and RHEL 5 Server.

Package(s( fixing the issue are: spacewalk-java-0.5.44-66.5.el[4,5]sat

Comment 10 errata-xmlrpc 2010-03-03 14:18:19 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0128.html