can't update profile when it's updated by API

Shuichi Ihara ihashu at gmail.com
Wed Dec 28 13:42:57 UTC 2011


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


More information about the cobbler mailing list