Created
March 14, 2017 14:43
-
-
Save cnelson/03e1cbaf0ce1472ef67fc765c3eb70e8 to your computer and use it in GitHub Desktop.
Revisions
-
cnelson created this gist
Mar 14, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/usr/bin/env python import re import subprocess import yaml import datetime since=datetime.datetime(2017, 2, 28, 0, 0, 0) # get one user toget the total number check = yaml.load(subprocess.check_output(['uaac', 'users', '--attributes', 'username', '--count', '1'])) total = check['totalresults'] data = yaml.load(subprocess.check_output(['uaac', 'users', '--attributes', 'username', '--attributes', 'meta.created', '--attributes', 'verified', '--count', str(total)])) assert data['itemsperpage'] == total is_email=r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)" for user in data['resources']: if re.match(is_email, user['username']) and user['meta.created'] >= since: user['created'] = user['meta.created'] print("{username}\t{created}".format(**user))