Comment 3 for bug 1221889

Revision history for this message
Arvind Tiwari (arvind-tiwari) wrote :

The following method has to raise NotFound in case of TokenNotFound

    def _verify_token(self, token_id, belongs_to=None):
        """Verify the given token and return the token_ref."""
        try:
            token_ref = self.token_api.get_token(token_id)
            return self._verify_token_ref(token_ref, belongs_to)
        except exception.TokenNotFound:
                raise exception.Unauthorized()