Bug 485123 - API: system.getCustomValues fails if system has a value containing null
API: system.getCustomValues fails if system has a value containing null
Product: Spacewalk
Classification: Community
Component: API (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Brad Buckingham
Jesus M. Rodriguez
Depends On:
Blocks: space05
  Show dependency treegraph
Reported: 2009-02-11 13:17 EST by Brad Buckingham
Modified: 2009-09-17 03:10 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-17 03:10:13 EDT
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 2009-02-11 13:17:52 EST
Description of problem:

If user defines a custom value for a system and the value is null, executing the the system.getCustomValues API will generate an error.

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

How reproducible:

Steps to Reproduce:
1. create a custom system info key... Systems->CustomSystemInfo->Create New Key
2. associate a value with the key for a system currently registered... Systems->System->Custom Info->create new value... during the "create new value" do not provide a "Value:"  (i.e. leave it blank) and click create/update.
3. execute the system.getCustomValues(sessionKey, systemId) for the system used in 2
Actual results:
Traceback (most recent call last):
  File "1883030-custom-field.py", line 9, in <module>
    result = sc.system.getCustomValues(key,1000010001) 
  File "/usr/lib/python2.5/xmlrpclib.py", line 1150, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1440, in __request
  File "/usr/lib/python2.5/xmlrpclib.py", line 1204, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1338, in _parse_response
  File "/usr/lib/python2.5/xmlrpclib.py", line 547, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: XML or text declaration not at start of entity:
line 1, column 192

Expected results:
receive a valid result such as {'key': ''}

Additional info:
Comment 1 Brad Buckingham 2009-02-11 13:23:07 EST
git commit: 95c6226e5f639fb905aaff27b8001dd81dde1533

Updated API so that if a system had a custom value of null, that it would return that value as "".  Chose this as opposed to skipping that value or throwing an exception because the UI allows a user to create a value with null for a system and in that case, it still allows the user to access those values.
Comment 2 Jesus M. Rodriguez 2009-04-14 10:13:00 EDT
Spacewalk 0.5 released.
Comment 3 Miroslav Suchý 2009-09-17 03:10:13 EDT
Spacewalk 0.5 has been released for long time ago.

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