Hello again,
I upgraded cobbler from 1.2.4 to 1.2.5. Now I have the error message:
xmlrpclib.Fault: <Fault 1: "cobbler.cexceptions.CX:'object has no method:
ks_meta'">
It is the same with 'ip_address', 'gateway'. So it appears it's not a
problem related to dictionaries, as I previously supposed.
I dived into the code, and I found out that attributes available for the
XMLRPC interface are hardcoded. The exhaustive list is :
'name'
'profile'
'image'
'kopts'
'kopts-post'
'ksmeta'
'hostname'
'kickstart'
'netboot-enabled'
'virt-path'
'virt-type'
'modify-interface'
'delete-interface'
'virt-path'
'virt-ram'
'virt-type'
'virt-cpus'
'virt-file-size'
'server'
'owners'
There are some subtle differences in attribute names betwwen those in YAML
files, those in the CLI and those in the XMLRPC interface. Perhaps it would
be a good idea to define those names in only one place, in order to increase
maintainability and usability.
Anyway, my problem is solved for the moment.
Thanks again.
Alain.
2008/10/8 Alain Barthe <[EMAIL PROTECTED]>
> OK, so the following syntax *should* work :
>
> remote.modify_distro(distro_id, 'ks_meta', {'onekey' : 'thevalue',
> 'other':'value'}, token).
>
> It does not on my box. As soon I get the real error message, I tell you.
>
> Thanks again.
>
> 2008/10/7 Michael DeHaan <[EMAIL PROTECTED]>
>
>> Alain Barthe wrote:
>> > Hi Michael, thanks for your reply.
>> >
>> > I realize that my original mail has been a bit garbagged, so you
>> > didn't understand my question.
>> > The question was : what is the syntax to set up a dictionary value
>> > through XMLRPC ?
>> >
>> > For scalar value, it is (as described in the wiki):
>> > remote.modify_distro(distro_id, 'name', 'example-distro',token)
>> > For a list, the following syntax works:
>> > remote.modify_distro(distro_id, 'users', ['admin'],token)
>> > But for a dictionary, I tried many syntaxes, none works.
>>
>> Do what I suggested first and then it will tell you what the actual
>> error message is. Then come back here with that error
>> if neccessary and we can tell you more.
>>
>> Dictionaries should work fine, the error may not be what it appears to
>> be. Do change the file first, restart cobblerd, and see what
>> message you get.
>>
>>
>> >
>> > Thanks for your reply.
>> >
>> > Alain.
>> >
>> > Others remarks are in the text below:
>> >
>> > 2008/10/7 Michael DeHaan <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]
>> >>
>> >
>> > 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 _"
>> >
>> >
>> > I tried it, but it does not work (maybe a too old version ? Mine is
>> 1.2.4
>> >
>> >
>> >
>> > 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).
>> >
>> >
>> > In my context, they are constant values as I define them at the global
>> > scope of my module.
>> >
>> >
>> >
>> > This will be included in the 1.2.6 stable update, which will
>> probably
>> > come out Friday.
>> >
>> > _______________________________________________
>> > cobbler mailing list
>> > [email protected] <mailto:
>> [email protected]>
>> > https://fedorahosted.org/mailman/listinfo/cobbler
>> >
>> >
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > cobbler mailing list
>> > [email protected]
>> > https://fedorahosted.org/mailman/listinfo/cobbler
>> >
>>
>> _______________________________________________
>> cobbler mailing list
>> [email protected]
>> https://fedorahosted.org/mailman/listinfo/cobbler
>>
>
>
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler