Add comment to test case helper function

Clarify what the use of os.urandom is for when generating
a secret for totp testing.

Change-Id: I04332d2acede8cdb430714cdb8b34d75b514fceb
This commit is contained in:
Morgan Fainberg 2016-05-20 21:29:32 +00:00
parent 68473b26ee
commit a0dc2f29ea
1 changed files with 2 additions and 0 deletions

View File

@ -409,6 +409,8 @@ def new_ec2_credential(user_id, project_id=None, blob=None, **kwargs):
def new_totp_credential(user_id, project_id=None, blob=None):
if not blob:
# NOTE(notmorgan): 20 bytes of data from os.urandom for
# a totp secret.
blob = base64.b32encode(os.urandom(20)).decode('utf-8')
credential = new_credential_ref(user_id=user_id,
project_id=project_id,