On Monday, January 30, 2012 at 9:07 AM, lists@truthisfreedom.org.uk wrote:
Hi all,I'm writing a ruby script that needs to manipulate the mgmtclassassigned to a system via the XMLRPC api.At the moment I have the code below, however although everything elseworks the mgmtclass remains blank - can anyone help with this?I've tried looking at the django web interface as suggested on thewiki to see how this done, however it appears to be driven by the"generic template" section of the code and I can't work out what'sgoing on there!I'm happy to contribute to the docs once I've got this working ifrequired, code is as follows (all system information is taken frompuppetlabs' facter):===========================require 'xmlrpc/client'require 'facter'server = XMLRPC::Client.new3(:host => "cobbler",:path => "/cobbler_api")token = server.call("login","cobbler","password")system_id = server.call("new_system","#{token}")server.call("modify_system","#{system_id}","name",Facter.value('fqdn'),"#{token}")server.call("modify_system","#{system_id}","hostname",Facter.value('fqdn'),"#{token}")server.call("modify_system","#{system_id}","modify_interface",Hash["macaddress-eth0" => Facter.value('macaddress_eth0'),"ipaddress-eth0" => Facter.value('ipaddress_eth0'),"dnsname-eth0" => Facter.value('fqdn')], "#{token}")###### THIS IS THE ISSUE LINE #####server.call("modify_system","#{system_id}","mgmtclass",["base"],"#{token}")##################server.call("save_system","#{system_id}","#{token}")server.call("sync", "#{token}")=========================================================Thanks in advance,Matt_______________________________________________cobbler mailing list