Bug 485123 - API: system.getCustomValues fails if system has a value containing null
Summary: API: system.getCustomValues fails if system has a value containing null
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 0.5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Brad Buckingham
QA Contact: Jesus M. Rodriguez
URL:
Whiteboard:
Depends On:
Blocks: space05
TreeView+ depends on / blocked
 
Reported: 2009-02-11 18:17 UTC by Brad Buckingham
Modified: 2009-09-17 07:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-17 07:10:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Brad Buckingham 2009-02-11 18:17:52 UTC
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:
always

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
    verbose=self.__verbose
  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
    p.feed(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 18:23:07 UTC
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 14:13:00 UTC
Spacewalk 0.5 released.

Comment 3 Miroslav Suchý 2009-09-17 07:10:13 UTC
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.