Bug 630877 - XMLRPC call client.system.getVariables() fails with "redstone.xmlrpc.XmlRpcFault: No such cobbler system record"
Summary: XMLRPC call client.system.getVariables() fails with "redstone.xmlrpc.XmlRpcFa...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 540
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Partha Aji
QA Contact: Petr Sklenar
URL:
Whiteboard:
Depends On:
Blocks: sat540-blockers
TreeView+ depends on / blocked
 
Reported: 2010-09-07 09:04 UTC by Jan Hutař
Modified: 2010-10-28 14:48 UTC (History)
3 users (show)

Fixed In Version: spacewalk-java-1.2.39-13-sat
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-28 14:48:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2010-09-07 09:04:09 UTC
Description of problem:
XMLRPC call client.system.getVariables() fails with "xmlrpclib.Fault: <Fault -214: 'redstone.xmlrpc.XmlRpcFault: No such cobbler system record'>"


Version-Release number of selected component (if applicable):
Satellite-5.4.0-RHEL5-re20100903.1


How reproducible:
always


Steps to Reproduce:
1. Use client.system.getVariables() XMLRPC call
   $ ./aaa.py admin admin https://<fqdn>/rpc/api 1000010000


Actual results:
Traceback like this:
Traceback (most recent call last):
  File "./aaa.py", line 28, in <module>
    print 'client.system.getVariables(): ', client.system.getVariables(key, SYSID)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -214: 'redstone.xmlrpc.XmlRpcFault: No such cobbler system record'>


Expected results:
Should return sane result.


Additional info:
I have used this script to get various info about system:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys, xmlrpclib

# load options
USER=sys.argv[1]
PASS=sys.argv[2]
SERVER=sys.argv[3]
SYSID=int(sys.argv[4])

# log-in
client = xmlrpclib.Server(SERVER, verbose=0)
key = client.auth.login(USER, PASS)

print 'client.system.getCpu(): ', client.system.getCpu(key, SYSID)
print 'client.system.getCustomValues(): ', client.system.getCustomValues(key, SYSID)
print 'client.system.getDetails(): ', client.system.getDetails(key, SYSID)
print 'client.system.getDevices(): ', client.system.getDevices(key, SYSID)
print 'client.system.getDmi(): ', client.system.getDmi(key, SYSID)
print 'client.system.getEntitlements(): ', client.system.getEntitlements(key, SYSID)
print 'client.system.getMemory(): ', client.system.getMemory(key, SYSID)
print 'client.system.getName(): ', client.system.getName(key, SYSID)
print 'client.system.getNetwork(): ', client.system.getNetwork(key, SYSID)
print 'client.system.getNetworkDevices(): ', client.system.getNetworkDevices(key, SYSID)
print 'client.system.getRunningKernel(): ', client.system.getRunningKernel(key, SYSID)
print 'client.system.getVariables(): ', client.system.getVariables(key, SYSID)

# log-out
client.auth.logout(key)

Comment 2 Jan Hutař 2010-09-08 06:26:22 UTC
No, that system in question was not provisioned. My problem here is that this call produces traceback instead of some reasonable return value (like empty list or something).

Comment 3 Partha Aji 2010-09-08 17:48:39 UTC
It is coded to raise an xmlrpc fault, for it expects the system to have a system record in cobbler as a bare minimum. Returning an empty list will imply that no variables were set, while raising the xmlrpc fault will imply that no system records exist. This is consistent with some of the other calls.

Comment 4 Partha Aji 2010-09-08 17:51:42 UTC
We could improve the documentation and state that the fault will be raised if there is no available system record. I 'll work on that..

Comment 5 Partha Aji 2010-09-08 18:02:18 UTC
The documentation should be fixed as of
http://git.fedorahosted.org/git/?p=spacewalk.git;a=commit;h=4e2cc722fecfea52b9d2a510539a4c0b0ca05e7d

You need spacewalk-java-1.2.31-1 or greater to test this.

Comment 6 Petr Sklenar 2010-09-22 14:41:05 UTC
there is new note:
==
To create a system record over xmlrpc use system.create_system_record
==
instead of system.createSystemRecord

this is tiny difference but then I cannot find it in API help ...

Comment 7 Partha Aji 2010-09-22 21:12:20 UTC
Actually they are both equivalent(as in one gets translated to the other). Anyway I changed the text to what you specified.

Comment 8 Petr Sklenar 2010-10-04 15:58:12 UTC
docs is updated:

 Method: getVariables
Description:
Lists kickstart variables set in the system record for the specified server. Note: This call assumes that a system record exists in cobbler for the given system and will raise an XMLRPC fault if that is not the case. To create a system record over xmlrpc use system.createSystemRecord To create a system record in the Web UI please go to System -> -> Provisioning -> Select a Kickstart profile -> Create Cobbler System Record. 
--
verified with Satellite-5.4.0-RHEL5-re20101001.1

Comment 9 Šimon Lukašík 2010-10-26 10:58:46 UTC
Verified in stage.

Comment 10 Clifford Perry 2010-10-28 14:44:05 UTC
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford


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