'HTTP DELETE request handler.'

@public
@cors_validation
@delay_denial
def DELETE(self, req):

    container_info = self.container_info(self.account_name, self.container_name, req)
    policy_index = req.headers.get('X-Backend-Storage-Policy-Index', container_info['storage_policy'])
    obj_ring = self.app.get_object_ring(policy_index)
    req.headers['X-Backend-Storage-Policy-Index'] = policy_index
    next_part_power = getattr(obj_ring, 'next_part_power', None)
    if next_part_power:
        req.headers['X-Backend-Next-Part-Power'] = next_part_power
    container_partition = container_info['partition']
    container_nodes = container_info['nodes']
    req.acl = container_info['write_acl']
    req.environ['swift_sync_key'] = container_info['sync_key']
    if ('swift.authorize' in req.environ):
        aresp = req.environ['swift.authorize'](req)
        if aresp:
            return aresp
    if (not container_nodes):
        return HTTPNotFound(request=req)
    (partition, nodes) = obj_ring.get_nodes(self.account_name, self.container_name, self.object_name)
    if ('x-timestamp' in req.headers):
        try:
            req_timestamp = Timestamp(req.headers['X-Timestamp'])
        except ValueError:
            return HTTPBadRequest(request=req, content_type='text/plain', body=('X-Timestamp    should    be    a    UNIX    timestamp    float    value;    was    %r' % req.headers['x-timestamp']))
        req.headers['X-Timestamp'] = req_timestamp.internal
    else:
        req.headers['X-Timestamp'] = Timestamp.now().internal
    node_count = len(nodes)
    policy = POLICIES.get_by_index(policy_index)
    policy_options = self.app.get_policy_options(policy)
    is_local = policy_options.write_affinity_is_local_fn
    if (is_local is not None):
        local_handoffs = policy_options.write_affinity_handoff_delete_count
        if (local_handoffs is None):
            local_primaries = [node for node in nodes if is_local(node)]
            local_handoffs = (len(nodes) - len(local_primaries))
        node_count += local_handoffs
    headers = self._backend_requests(req, node_count, container_partition, container_nodes)
    return self._delete_object(req, obj_ring, partition, headers)
