Make try/except work for passlib 1.6 and 1.7

Change-Id: I126410ce6a57dd298ea5b62a035174eb35d2c138
Related-Bug: 1644263
This commit is contained in:
Lance Bragstad 2016-11-28 17:15:21 +00:00
parent 60ac827332
commit 7e9039bf51
1 changed files with 3 additions and 2 deletions

View File

@ -136,9 +136,10 @@ def hash_password(password):
return passlib.hash.sha512_crypt.encrypt(
password_utf8, rounds=CONF.crypt_strength)
except DeprecationWarning:
# TODO(stevemar): Remove this warning once we switch over to passlib
# TODO(stevemar): Remove this try/except once we switch over to passlib
# version 1.7.0 and replace encrypt() with hash()
pass
return passlib.hash.sha512_crypt.hash(
password_utf8, rounds=CONF.crypt_strength)
def check_password(password, hashed):