Hi,

Cobbler 1.6.8
coding in PHP

We are using xmlrpc to sync system data stored in ldap to cobbler.
Is it possible to remove one interface from a system stored in cobbler ?
The only xmlrpc function I can find is "modify-interface"

So I tried to NULLify all vars of the interface-ethX array, but this 
gives an error.
This is the expert of the code of my attempt to delete the interface.

             # cleanup/remove interfaces not in ldap anymore
             foreach ( $this->ldapHost["interfaces"] as $key => $value ) {
                 $empty_interface=array(
                     "macaddress-" . $value["name"]      => NULL,
                     "ipaddress-" . $value["name"]       => NULL,
                     "gateway-" . $value["name"]         => NULL,
                     "virtbridge-" . $value["name"]      => NULL,
                     "dnsname-" . $value["name"]         => NULL,
                     "static-" . $value["name"]          => NULL,
                     "dhcptag-" . $value["name"]         => NULL,
                     "staticroutes-" . $value["name"]    => NULL
                 );


                 $this->cobbler_connection->send(new 
xmlrpcmsg('modify_system', array(new xmlrpcval($handle,"string"), new 
xmlrpcval("modify-interface","string"),
                                                 new 
xmlrpcval($empty_interface,"struct"), new 
xmlrpcval($this->cobbler_token,"string"))));
             }

This gives following result :
Array
(
     [macaddress-eth0] =>
     [ipaddress-eth0] =>
     [gateway-eth0] =>
     [virtbridge-eth0] =>
     [dnsname-eth0] =>
     [static-eth0] =>
     [dhcptag-eth0] =>
     [staticroutes-eth0] =>
)
PHP Fatal error:  Call to a member function serialize() on a non-object 
in /opt/scripts/xmlrpc.inc on line 2974


Removing the system from cobbler, and recreating it, is not an option.

Anyone who knows a way to achieve this  ?

In the meantime, I'm trying to put a ldap -> cobbler sync module 
together using cobbler modules and python.
But for now, the php script is doing the job, except for deleting the 
interfaces.

Thx

Johan


_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to