File "/usr/lib/python2.6/site-packages/cm_api/api_client.py", line 160, in delete_host return hosts.delete_host(self, host_id) File "/usr/lib/python2.6/site-packages/cm_api/endpoints/hosts.py", line 63, in delete_host return call(resource_root.delete, "%s/%s" % (HOSTS_PATH, host_id), ApiHost) File "/usr/lib/python2.6/site-packages/cm_api/endpoints/types.py", line 139, in call ret = method(path, params=params) File "/usr/lib/python2.6/site-packages/cm_api/resource.py", line 134, in delete return self.invoke("DELETE", relpath, params) File "/usr/lib/python2.6/site-packages/cm_api/resource.py", line 73, in invoke headers=headers) File "/usr/lib/python2.6/site-packages/cm_api/http_client.py", line 174, in execute raise self._exc_class(ex) cm_api.api_client.ApiException: Cannot delete host with associated roles. (error 400)
I know the problem was that the roles on the hosts should be deleted first. But I couldn't find a way how to do that. Does anyone have the corresponding function call?