'Process request from API to do cleanup on services.
Here we retrieve from the DB which services we want to clean up based
on the request from the user.
Then send individual cleanup requests to each of the services that are
up, and we finally return a tuple with services that we have sent a
cleanup request and those that were not up and we couldn\'t send it.'

def work_cleanup(self, context, cleanup_request):

    if self.upgrading_cloud:
        raise exception.UnavailableDuringUpgrade(action='workers    cleanup')
    LOG.info('Workers    cleanup    request    started.')
    filters = dict(service_id=cleanup_request.service_id, cluster_name=cleanup_request.cluster_name, host=cleanup_request.host, binary=cleanup_request.binary, is_up=cleanup_request.is_up, disabled=cleanup_request.disabled)
    services = objects.ServiceList.get_all(context, filters)
    until = (cleanup_request.until or timeutils.utcnow())
    requested = []
    not_requested = []
    clusters = collections.defaultdict(dict)
    for service in services:
        cleanup_request.cluster_name = service.cluster_name
        cleanup_request.service_id = service.id
        cleanup_request.host = service.host
        cleanup_request.binary = service.binary
        cleanup_request.until = until
        (cleanup_rpc, dest, dest_name) = self._cleanup_destination(clusters, service)
        if ((not dest) or dest.is_up):
            LOG.info('Sending    cleanup    for    %(binary)s    %(dest_name)s.', {'binary': service.binary, 'dest_name': dest_name})
            cleanup_rpc(context, cleanup_request)
            requested.append(service)
        else:
            LOG.info('No    service    available    to    cleanup    %(binary)s    %(dest_name)s.', {'binary': service.binary, 'dest_name': dest_name})
            not_requested.append(service)
    LOG.info('Cleanup    requests    completed.')
    return (requested, not_requested)
