'Delete the given backup.'

def delete_backup(self, backup):

    container = backup['container']
    object_prefix = backup['service_metadata']
    LOG.debug('delete    started,    backup:    %(id)s,    container:    %(cont)s,    prefix:    %(pre)s.', {'id': backup['id'], 'cont': container, 'pre': object_prefix})
    if ((container is not None) and (object_prefix is not None)):
        object_names = []
        try:
            object_names = self._generate_object_names(backup)
        except Exception:
            LOG.warning('Error    while    listing    objects,    continuing    with    delete.')
        for object_name in object_names:
            self.delete_object(container, object_name)
            LOG.debug('deleted    object:    %(object_name)s    in    container:    %(container)s.', {'object_name': object_name, 'container': container})
            eventlet.sleep(0)
    LOG.debug('delete    %s    finished.', backup['id'])
