'Delete a keypair with a given name.'

def _delete(self, req, id, user_id=None):

    context = req.environ['nova.context']
    user_id = (user_id or context.user_id)
    context.can((kp_policies.POLICY_ROOT % 'delete'), target={'user_id': user_id, 'project_id': context.project_id})
    try:
        self.api.delete_key_pair(context, user_id, id)
    except exception.KeypairNotFound as exc:
        raise webob.exc.HTTPNotFound(explanation=exc.format_message())
