Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 463543 - satellite.listEntitlements API - inconsistent behavior and generates error if run by Org Admin
Summary: satellite.listEntitlements API - inconsistent behavior and generates error i...
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 0.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Brad Buckingham
QA Contact: Red Hat Satellite QA List
Depends On:
Blocks: space04
TreeView+ depends on / blocked
Reported: 2008-09-23 20:58 UTC by Brad Buckingham
Modified: 2009-01-22 16:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-01-22 16:30:00 UTC

Attachments (Terms of Use)

Description Brad Buckingham 2008-09-23 20:58:24 UTC
Description of problem:

This API call seems to not be clear in its objectives and actual results when implementing multi-org.

With my satellite and cert at this time there are 208 free_slots. Querying the satellite.listEntitlements API with the "Satellite Administrator" or an "Organization Administrator" user for organization one shows this.

After creating a new organization and allocation 10 management slots to it, the free_slots decrements by 10 to report 198. While the arithmetic seems straight-forward enough, that is not consistent with the API documentation page: Lists all channel and system entitlements *on*the*satellite*.

When I use the "Organization Administrator" account for the second organization, I get this error:

xml declaration not at start of external entity at line 6, column 15, byte 470 at /us
r/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/XML/ line 187

This error is reported in /var/log/tomcat5/catalina.out as a java.lang.NullPointerException: null

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:
Given the documentation and actual results I'm not exactly sure what I would expect -- other than "not an error".

I would prefer that free_slots (and other information) is reportable on a per-organization basis.

Additional info:

Comment 1 Brad Buckingham 2008-09-23 21:04:40 UTC
Updated the satellite.listEntitlements API to properly handle the error scenario.  Also updated the API documentation to better reflect the expected behavior of the API.  E.g. "Lists all channel and system entitlements for the organization associated with the user executing the request."

The data returned by invoking this API should be consistent the Entitlement counts that would be provided to a user if they logged in to the web-ui and selected:
   Subscription Management -> System Entitlements
   Subscription Management -> Software Channel Entitlements

It should be noted that there are several additional API methods which provide different views of entitlements.  E.g.
   org.listSoftwareEntitlements(session, entitlement)
   org.listSoftwareEntitlementsForOrg(session, orgId)
   org.listSystemEntitlements(session, entitlement)
   org.listSystemEntitlements(session, orgId)

Comment 2 Brad Buckingham 2009-01-15 14:17:25 UTC
verified on spacewalk-java-0.4.14-1.el5

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