'Force delete of instance before deferred cleanup.'

@wsgi.response(202)
@extensions.expected_errors((404, 409))
@wsgi.action('forceDelete')
def _force_delete(self, req, id, body):

    context = req.environ['nova.context']
    instance = common.get_instance(self.compute_api, context, id)
    context.can(dd_policies.BASE_POLICY_NAME, target={'user_id': instance.user_id, 'project_id': instance.project_id})
    try:
        self.compute_api.force_delete(context, instance)
    except (exception.InstanceNotFound, exception.InstanceUnknownCell) as e:
        raise webob.exc.HTTPNotFound(explanation=e.format_message())
    except exception.InstanceIsLocked as e:
        raise webob.exc.HTTPConflict(explanation=e.format_message())
