Log token setup failure properly

This commit is contained in:
Bálint Bokros 2018-02-19 09:49:51 +01:00
parent 3e54733033
commit acb292460f

View File

@ -15,7 +15,10 @@ log = logging.getLogger(__name__)
async def setup_token(solvable_connector, token):
solvable_connector.send('token', token)
key, data = await solvable_connector.recv()
log.debug('Token setup is done.')
if secrets.compare_digest(token, key):
log.debug('Token setup is done.')
else:
log.error('Failed to setup token between controller and solvable.') # TODO: signaling to Avatao platform?
if __name__ == '__main__':
kwargs = {