[Spacewalk-list] question regarding spacewalk api system.setCustomValues method

Yang Li yangli at clemson.edu
Wed May 30 02:25:32 UTC 2018


This is spacewalk api docutment regarding system.setcustomValues method:

Method: setCustomValues<https://hci-inf-p-spw01.clemson.edu/rhn/apidoc/handlers/SystemHandler.jsp#top>
Description:
Set custom values for the specified server.
Parameters:

  *   string sessionKey
  *   int serverId
  *   struct - Map of custom labels to custom values
     *   string "custom info label"
     *   string "value"

What is correct way to pass Map of custom labels to custom values? I tried following but got an error. Look like it does not like what I passed in for Map of custom labels to custom values. what exactly I should pass to the setCustomValue? Should it be a python dictionary or something else?

junk = {}
junk[“test”] = “value”

client.system.setCustomValues(key, system[“id”], junk)


this is error I got:

    client.system.setCustomValues(key, system["id"], junk)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1243, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1602, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1283, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1316, in single_request
    return self.parse_response(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1493, in parse_response
    return u.close()
  File "/usr/lib64/python2.7/xmlrpclib.py", line 800, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1000: 'redstone.xmlrpc.XmlRpcFault: One or more of the following custom info fields was not defined: \ntest'>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20180530/f3d20f2b/attachment.htm>


More information about the Spacewalk-list mailing list