Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paliwalvimal committed Jun 4, 2021
1 parent 50eefcd commit d5b6e40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def create_user_key(userName, user):
if len(user['keys']) == 0:
logger.info('Skipping key creation for {} because no existing key found'.format(userName))
elif len(user['keys']) == 2:
logger.warn('Skipping key creation {} because 2 keys already exist. Please delete anyone to create new key'.format(userName))
logger.warn('Skipping key creation for {} because 2 keys already exist. Please delete anyone to create new key'.format(userName))
else:
for k in user['keys']:
rotationAge = user['attributes']['rotate_after'] if 'rotate_after' in user['attributes'] else ACCESS_KEY_AGE
if k['ak_age_days'] <= rotationAge:
if k['ak_age_days'] <= int(rotationAge):
logger.info('Skipping key creation for {} because existing key is only {} day(s) old and the rotation is set for {} days'.format(userName, k['ak_age_days'], rotationAge))
else:
logger.info('Creating new access key for {}'.format(userName))
Expand Down

0 comments on commit d5b6e40

Please sign in to comment.