I'm doing the following calls via xmlrpc to cobbler
profile = distro.install_name #RHEL5-Server-U3_nfs-i386
systemprofile = self.system.fqdn #
machine-01.example.domain.com
try: # If a profile with the name of the system already exists then
use it.
pid = self.remote.get_profile_handle(self.system.fqdn, self.token)
except: # Otherwise create it new.
pid = self.remote.new_subprofile(self.token)
self.remote.modify_profile(pid, "name", self.system.fqdn, self.token)
if self.remote.read_or_write_kickstart_template(kickfile, False,
kickstart, self.token):
self.remote.modify_profile(pid, 'kickstart', kickfile, self.token)
# Set the parent of the sub-profile to the profile. in this case
RHEL5-Server-U3_nfs-i386
self.remote.modify_profile(pid, 'parent', profile, self.token)
self.remote.save_profile(pid, self.token)
else:
raise BX(_("Failed to save kickstart"))
self.remote.modify_system(system_id, 'profile', systemprofile, self.token)
self.remote.modify_system(system_id, 'netboot-enabled', True, self.token)
and getting the following traceback. Have the calls changed for creating
sub-profiles?
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - DEBUG | get_item; ['profile',
'machine-01.rhts.bos.redhat.com']
Mon Jun 28 16:24:53 2010 - INFO | Exception occured: cobbler.cexceptions.CX
Mon Jun 28 16:24:53 2010 - INFO | Exception value: 'internal error,
unknown profile name machine-01.example.domaincom'
Mon Jun 28 16:24:53 2010 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1747,
in _dispatch
return method_handle(*params)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 635,
in get_profile_handle
return self.get_item_handle("profile",name,token)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 629,
in get_item_handle
raise CX("internal error, unknown %s name %s" % (what,name))
Mon Jun 28 16:24:53 2010 - INFO | REMOTE new_item(profile); user(testing)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing', 'new_profile',
None, None, True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE modify_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==);
attribute(name)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'modify_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
'name', True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE write_kickstart_template;
user(testing);
name(/var/lib/cobbler/kickstarts/machine-01.rhts.bos.redhat.com.ks)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'write_kickstart_template',
'/var/lib/cobbler/kickstarts/machine-01.rhts.bos.redhat.com.ks', False,
True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE modify_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==);
attribute(kickstart)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'modify_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
'kickstart', True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE modify_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==);
attribute(parent)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'modify_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
'parent', True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE save_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'save_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
None, True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | add_item(profile);
['machine-01.rhts.bos.redhat.com']
Mon Jun 28 16:24:53 2010 - DEBUG | get_items; ['profile']
Mon Jun 28 16:24:53 2010 - INFO | Exception occured:
exceptions.AttributeError
Mon Jun 28 16:24:53 2010 - INFO | Exception value: 'int' object has no
attribute 'copy'
Mon Jun 28 16:24:53 2010 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1747,
in _dispatch
return method_handle(*params)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 872,
in save_profile
return self.save_item("profile",object_id,token,editmode=editmode)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 866,
in save_item
rc = self.api.add_item(what,obj)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 394, in
add_item
return
self.get_items(what).add(ref,check_for_duplicate_names=check_for_duplicate_names,save=save,logger=logger)
File "/usr/lib/python2.4/site-packages/cobbler/collection.py", line
286, in add
self.lite_sync.add_single_profile(ref.name)
File "/usr/lib/python2.4/site-packages/cobbler/action_litesync.py",
line 103, in add_single_profile
self.sync.pxegen.write_templates(profile)
File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 684,
in write_templates
blended = utils.blender(self.api, False, obj)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 612,
in blender
__consolidate(node,results)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 780,
in __consolidate
results[field].update(data_item.copy())