def deleteAllSystems(server):
 try:
  (client, key) = _get_session(server)
 except Exception as exc:
  err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
  log.error(err_msg)
  return {'Error': err_msg}
 systems = client.system.listSystems(key)
 ids = []
 names = []
 for system in systems:
  ids.append(system['id'])
  names.append(system['name'])
 if (client.system.deleteSystems(key, ids) == 1):
  return {'deleted': names}
 else:
  return {'Error': 'Failed to delete all systems'}

def deleteAllSystems ( server ) : try : ( client , key ) = _get_session ( server ) except Exception as exc : err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}' . format ( server , exc ) log . error ( err_msg ) return { 'Error' : err_msg } systems = client . system . listSystems ( key ) ids = [ ] names = [ ] for system in systems : ids . append ( system [ 'id' ] ) names . append ( system [ 'name' ] ) if ( client . system . deleteSystems ( key , ids ) == 1 ) : return { 'deleted' : names } else : return { 'Error' : 'Failed to delete all systems' }
delete all systems from spacewalk cli example: .