Update 'make_user_accounts.py'

master
manetta 3 years ago
parent 4044509e77
commit a0251cb129

@ -17,7 +17,7 @@ ap.add_argument("--nginx", type=argparse.FileType("w"), default="users.nginx.con
ap.add_argument("--md", type=argparse.FileType("w"), default="users.md")
ap.add_argument("--port", type=int, default=9060)
ap.add_argument("--addusers", action="store_true", default=False)
ap.add_argument("--servername", type=str, default="sandbox")
ap.add_argument("--servername", default="sandbox")
args = ap.parse_args()
passwords = args.passwords.read().strip().splitlines()
@ -26,7 +26,7 @@ template_env = Environment(loader=FileSystemLoader(args.templates))
curport = args.port
usernames = args.from_file.read().strip().splitlines()
servername = args.servername.read().strip()
nbconfig = template_env.get_template("jupyter_notebook_config.py")
csvout = writer(args.csv)
csvout.writerow("username port password".split())
@ -40,7 +40,7 @@ for username in usernames:
userdata['password'] = password
userdata['password_sha1'] = passwd(password)
userdata['port'] = curport
userdata['servername'] = servername
userdata['servername'] = servername
users.append(userdata)
csvout.writerow((userdata['username'], userdata['port'], userdata['password']))
curport += 1

Loading…
Cancel
Save