Update Warrant (#11101)

* Update Warrant

* Lint
This commit is contained in:
Paulus Schoutsen 2017-12-12 21:12:41 -08:00 committed by GitHub
parent 95cd2035b6
commit 168065b9bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View file

@ -68,11 +68,14 @@ def register(cloud, email, password):
from botocore.exceptions import ClientError
cognito = _cognito(cloud)
# Workaround for bug in Warrant. PR with fix:
# https://github.com/capless/warrant/pull/82
cognito.add_base_attributes()
try:
if cloud.cognito_email_based:
cognito.register(email, password, email=email)
cognito.register(email, password)
else:
cognito.register(_generate_username(email), password, email=email)
cognito.register(_generate_username(email), password)
except ClientError as err:
raise _map_aws_exception(err)