Alain Barthe wrote:
> Hello,
>
> I'm new to this list, I'm new to cobbler too : great tool !
>
> I want to create a system from a non cobbler host through XMLRPC. I
> followed the wiki and I am ableto create it and to set some scalar
> value as it is described in
> https://fedorahosted.org/cobbler/wiki/CobblerXmlrpc.
>
> But I have to set ks_meta variable that is a sort of dictionary. I
> tried several ways without success :
>
> COBSERVER.modify_system(cobid, 'ks_meta', "{'ip': '165.7.120.253
> <http://165.7.120.253>', 'netmask': '255.255.255.0
> <http://255.255.255.0>', 'hostname': 'blade04', 'gateway':
> '165.7.120.33 <http://165.7.120.33>'}", TOKEN)
> COBSERVER.modify_system(cobid, 'ks_meta', 'ip=165.7.120.253
> <http://165.7.120.253> netmask=255.255.255.0 <http://255.255.255.0>
> hostname=blade04 gateway=165.7.120.33 <http://165.7.120.33>', TOKEN)
> and the same as above with different quoting styles.
The error below is not a direct error from the above per se, but an
error in the code that produces the actual exception text -- it's an
error while telling you what the error is :). This is fixed on the
latest development branch and I also applied this change just now to
master.
You can also fix this by adding the following line to remote.py
"from utils import _"
Once you do that and restart cobblerd, you'll get the actual error which
will help you more. Both forms of input are accepted and correct.
(As a sidenote, Generally you want to avoid uppercase in Python -- it
implies a constant value, while COBSERVER is really a xmlrpc server
proxy object and TOKEN is a string variable).
This will be included in the 1.2.6 stable update, which will probably
come out Friday.
>
> The error message is always the same and seems to be weird :
>
> xmlrpclib.Fault: <Fault 1: "exceptions.NameError:global name '_' is
> not defined">
>
> By reading the remote.py code, I noted maybe a bug in copy_* function,
> for example :
>
> def copy_profile(self,object_id,token=None):
> self.log("copy_profile",object_id=object_id,token=token)
> self.check_access(token,"copy_profile")
> obj = self.__get_object(object_id)
> return self.api.copy_profile(obj,newname)
>
> It seems that the "newname" parameter is missing.
Thanks for the heads up -- this is in fact unrelated as nothing is
making use of this function, but it's still wrong.
I'll fix this as well.
>
> Thanks for your help !
>
> Alain.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> cobbler mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/cobbler
>
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler