Skip to content
Snippets Groups Projects
Commit eda7e296 authored by Conrad Holmberg's avatar Conrad Holmberg
Browse files

Adding procedures for restoring users from file.

parent 540fea80
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ if __name__ == '__main__':
# user invoked variables
parser.add_argument('--list_fqdn', default=LIST_NAME)
parser.add_argument('-l','--list_fqdn')
parser.add_argument('-r','--restore')
# Add arguments for env variables
parser.add_argument('--core-uri', dest='core_uri', default=CORE_URI)
......@@ -101,8 +101,18 @@ if __name__ == '__main__':
else:
sys.exit('Error: Email list"'+ml_fqdn+'" does not exist in domain '+args.core_uri +
"\nSee List\n"+get_ml_fqdns(ml_fqdns))
elif args.restore:
if args.list == '-':
list_file = sys.stdin
if args.restore:
#Open user list dump file
print "restoring file."
if args.restore == '-':
user_file = sys.stdin
else:
lsist_file = open(args.list, 'r')
user_file = open(args.restore, 'r')
for l in user_file:
member_email = l.strip()
print("Received {}".format(member_email))
#new_member_list.append(member_email)
if args.restore != '-':
list_file.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment