Thanks. I just replaced with xmlrpc, and now all works well.

Ihara

(12/29/11 12:38 AM), Michael DeHaan wrote:
Don't use the python lib, use the xmlrpc ... The python lib is for cobbler's 
internal use and can only be used by the daemon.  Koan and the webapp both show 
xmlrpc examples.

-- Michael

On Dec 28, 2011, at 8:42 AM, Shuichi Ihara<[email protected]>  wrote:


Hi,

I'm updating the profile in system object with the following quick Python 
script and the profile seems to be updated.

#!/usr/bin/python

import re, codecs
import cobbler.api as api
cobbler = api.BootAPI()

system = cobbler.find_system(name="r07")
print system.profile
system.set_profile("rhel5.7")
cobbler.add_system(system)
print system.profile

But, "cobbler system report" shows still old profile name. Here is an sample.

# cobbler system report --name=r07 | grep Profile
Profile                        : rhel6.2

# ./update_profile.py
rhel6.2
rhel5.7

# ./update_profile.py
rhel5.7
rhel5.7

# cobbler system report --name=r07 | grep Profile
Profile                        : rhel6.2

When I restart the coblblerd, the profile is updated even on "cobbler system".

# /etc/init.d/cobblerd restart
# cobbler system report --name=r07 | grep Profile
Profile                        : rhel5.7

Am I wrong or missing something in Python script?

Please advise.

Thanks
Ihara
_______________________________________________
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

Reply via email to