import crypt import click from . import app, redis_store, redis_key_for_user @app.cli.command() @click.argument("username") @click.option("--passwd", "-p", prompt="Password", help="Password", hide_input=True) def adduser(username, passwd): """Add UUS admin user""" cryptpwd = crypt.crypt(passwd) redis_store.set(redis_key_for_user(username), cryptpwd) @app.cli.command() @click.argument("username") @click.option("--passwd", "-p", prompt="Password", help="Password", hide_input=True) def passwd(username, passwd): """Change UUS admin user password""" adduser(username, passwd) @app.cli.command() @click.argument("username") def deluser(username): """Delete UUS admin user""" redis_store.delete(redis_key_for_user(username))