(self, tokens)
Check if tokens on the provided list can be modified.
Check if tokens on the provided list can be modified.
Check if tokens on the provided list can be modified .
def _verify_modify_tokens(self, tokens):
        """Check if tokens on the provided list can be modified."""
        for token in tokens:
            if token.name in self._trie:
                existing_token = self._trie[token.name]
                assert token.name == existing_token.name
                assert existing_token.version
                if existing_token.version != token.version:
                    raise TokenMasterException(
                        ErrorCode.VERSION_CONFLICT,
                        'token %s with different version %d found' %
                        (existing_token.name, existing_token.version))
            elif token.version:
                raise TokenMasterException(ErrorCode.NOT_FOUND,
                                           'token %s not found' % token.name)
def _verify_modify_tokens ( self , tokens ) : for token in tokens : if token . name in self . _trie : existing_token = self . _trie [ token . name ] assert token . name == existing_token . name assert existing_token . version if existing_token . version != token . version : raise TokenMasterException ( ErrorCode . VERSION_CONFLICT , 'token %s with different version %d found' % ( existing_token . name , existing_token . version ) ) elif token . version : raise TokenMasterException ( ErrorCode . NOT_FOUND , 'token %s not found' % token . name )