[et-mgmt-tools] Recursive distro delete trying to remove a profile more than once?

Charles Duffy Charles_Duffy at messageone.com
Mon Jul 14 06:25:22 UTC 2008


Howdy. I'm trying to remove a number of distros and profiles, and 
hitting exceptions similar to the following:

Traceback (most recent call last):
   File "cobbler_sync.py", line 132, in run
     cobbler_api.distros().remove(distro.name, with_delete=True, 
recursive=True)
   File 
"/usr/lib/python2.4/site-packages/cobbler/collection_distros.py", line 
51, in remove
     self.config.api.remove_profile(k, recursive=True)
   File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 176, in 
remove_profile
     return self._config.profiles().remove(ref.name, recursive=recursive)
   File 
"/usr/lib/python2.4/site-packages/cobbler/collection_profiles.py", line 
70, in remove
    raise CX(_("cannot delete an object that does not exist: %s") % name)
cobbler.cexceptions.CX: 'cannot delete an object that does not exist: 
centos-5.1-xen-x86_64'


The calling code looks like the following:

  for distro in list(cobbler_api.distros()):
    if not cobbler_api.find_distro(distro.name):
      continue # we've been removed by a recursive delete
    if not distro.name in desired_distro_list:
      logger.info('removing distro %r' % (distro.name,))
      if not noop:
        cobbler_api.distros().remove(distro.name, with_delete=True, 
recursive=True)

This issue is reproduced after the import of a new distribution.




More information about the et-mgmt-tools mailing list