Bug 525298 - API Overview sample python script uses too many parameters for user.list_users
Summary: API Overview sample python script uses too many parameters for user.list_users
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Documentation
Version: 530
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: John Ha
QA Contact: Šimon Lukašík
URL:
Whiteboard:
Depends On:
Blocks: sat531-docs
TreeView+ depends on / blocked
 
Reported: 2009-09-23 20:24 UTC by Vinny Valdez
Modified: 2014-08-04 22:18 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-23 07:10:44 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0369 normal SHIPPED_LIVE Red Hat Network Satellite bug fix update 2010-04-23 07:01:54 UTC

Description Vinny Valdez 2009-09-23 20:24:11 UTC
Description of problem:
The python example at http://www.redhat.com/docs/en-US/Red_Hat_Network_Satellite/5.3/API_Overview/html/scripts.html doesn't work.  The line "list = client.user.list_users(key, 'admin')" is calling the method "user.list_users" which only accepts one parameter - the sessionKey.  Simply removing the second parameter 'admin' works.

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

How reproducible:
Everytime

Steps to Reproduce:
1. Visit the "API Overview" documentation page for RHN Satellite
2. Click on "example scripts"
3. Copy/paste the python example
4. Set your URL, LOGIN, and PASSWORD variables
5. Run the script and view the error

Actual results:
user.list_users only accepts one parameter, but the example script has an additional parameter of 'admin', which results in the following error:

xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: Could not find method listUsers in class class com.redhat.rhn.frontend.xmlrpc.user.UserHandler'>
  
Expected results:
After removing the second parameter, the script runs and all users are listed.

Comment 1 John Ha 2009-11-04 08:19:38 UTC
I will fix this on the website. Fixing so the line will read:

list = client.user.list_users(key)

Setting NEEDINFO flag to jsherril, as he generated the API docs and can fix them
from the content sources for future releases.

Comment 3 Brandon Perkins 2010-03-06 05:38:10 UTC
Fails QA.  What is on there is not right in a lot of ways.  We need to figure out what we're trying to do as the description is:

Below is an example of the user.listAdministeredSystemGroups call being used. Only the name of each group is printed. 

The problem is, this method does not exist.  And that's what is being called in the documentation:

list = client.user.list_administered_system_groups(key, 'admin')

So, it looks like we both need to figure out what we're trying to demo and fix the code so it works.  Used:

https://rlx-3-14.rhndev.redhat.com/rhn/apidoc/scripts.jsp

Comment 4 Justin Sherrill 2010-03-11 20:19:08 UTC
Spacewalk master

0d2a9213947e48abcde9dda8e7338565f4427c4b

satellite git:
e8672b756e2bce5b4a21abda5be406542ddd1684

Comment 7 Šimon Lukašík 2010-04-02 12:03:21 UTC
Changing to verified:

Testing procedure:
Same as bug 530022, comment 7 as it was both fixed in same patch

Verified against: (on rhel-i386-server-5-u4) 
*-0.5.28-40.x.2

Comment 9 errata-xmlrpc 2010-04-23 07:10:44 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-0369.html


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