Skip to content
Snippets Groups Projects

ENH: set user realm when chaning passwords

Merged Alexander Schlemmer requested to merge f-user-realm-new into dev
@@ -42,6 +42,13 @@ __updated__ = '2018-12-11'
def do_update_role(args):
"""
Update the description of a role.
Allowed keyword arguments:
role_name: Name of the role to update
role_description: New description of the role
"""
admin._update_role(name=args.role_name, description=args.role_description)
@@ -123,7 +130,6 @@ def do_create_user(args):
try:
admin._insert_user(name=args.user_name,
email=args.user_email, password=password)
if args.activate_user:
do_activate_user(args)
except HTTPClientError as e:
@@ -150,7 +156,7 @@ def do_set_user_password(args):
else:
password = args.user_password
try:
admin._update_user(name=args.user_name, password=password)
admin._update_user(name=args.user_name, password=password, realm=args.realm)
except HTTPClientError as e:
print(e.msg)
@@ -364,6 +370,12 @@ USAGE
metavar='USERNAME',
dest="user_name",
help="The name of the user who's password is to be set.")
subparser.add_argument(
metavar='REALM',
dest="realm",
nargs="?",
default=None,
help="The realm of the user who's password is to be set.")
subparser.add_argument(
metavar='PASSWORD',
nargs="?",
Loading