Allow setting password via CLI for scripting

This commit is contained in:
Tim Van Baak 2020-01-24 10:18:05 -08:00
parent 0cb6e78752
commit a73f7b6cdc
1 changed files with 2 additions and 1 deletions

View File

@ -107,6 +107,7 @@ def command_config(args):
config_set(u.id, cfg, args.set)
@add_argument("--username", help="The user to change password for")
@add_argument("--password", help="The password to set. Not recommended")
def command_passwd(args):
"""
Set a user's password
@ -123,5 +124,5 @@ def command_passwd(args):
if u is None:
logger.error("No user with username '{}'".format(args.username))
return -1
pw = getpass.getpass("Password: ")
pw = args.password or getpass.getpass("Password: ")
u.set_password(pw)