Comment 1 for bug 1099966

Revision history for this message
Ante Karamatić (ivoks) wrote :

How about checking if the token exist before creating the same one?

try:
    self.token_api.get_token(context=context,
                                                   token_id=token_id)
except exception.TokenNotFound:
    self.token_api.create_token(...

In that case, if token exists, everything is fine (it might even get deleted just after we fetch it).