Bug 463543 - satellite.listEntitlements API - inconsistent behavior and generates error if run by Org Admin
satellite.listEntitlements API - inconsistent behavior and generates error i...
Product: Spacewalk
Classification: Community
Component: API (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brad Buckingham
Red Hat Satellite QA List
Depends On:
Blocks: space04
  Show dependency treegraph
Reported: 2008-09-23 16:58 EDT by Brad Buckingham
Modified: 2009-01-22 11:30 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-22 11:30:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Brad Buckingham 2008-09-23 16:58:24 EDT
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/Parser.pm 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 17:04:40 EDT
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 09:17:25 EST
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.