VMM/cli/subcommands: userpassword added option -s. v0.7.x
authorPascal Volk <user@localhost.localdomain.org>
Sat, 15 Feb 2014 19:00:40 +0000
branchv0.7.x
changeset 728 69eb7a65d8a4
parent 727 695426b49de0
child 729 26a6231b9c6a
VMM/cli/subcommands: userpassword added option -s. -s SCHEME can be used to (temporarily) override the password_scheme setting, configured in vmm.cfg.
VirtualMailManager/cli/subcommands.py
--- a/VirtualMailManager/cli/subcommands.py	Sat Feb 15 18:07:00 2014 +0000
+++ b/VirtualMailManager/cli/subcommands.py	Sat Feb 15 19:00:40 2014 +0000
@@ -396,7 +396,8 @@
 
 def user_password(ctx):
     """update the password for the given address"""
-    ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password)
+    ctx.hdlr.user_password(ctx.args.address.lower(), ctx.args.password,
+                           ctx.args.scheme)
 
 
 def user_note(ctx):
@@ -832,12 +833,15 @@
            help=_('update the password for the given address'),
            epilog=fill(_("The password of an account can be updated with this "
                "subcommand.\n\nIf no password was provided, vmm will prompt "
-               "for it interactively.")),
+               "for it interactively. When the scheme was omitted, vmm will "
+               "use misc.password_scheme from vmm.cfg. ")),
            formatter_class=RawDescriptionHelpFormatter)
     up.add_argument('address',
                     help=_("an account's e-mail address (local-part@fqdn)"))
     up.add_argument('-p', metavar='PASSWORD', dest='password',
                     help=_("the user's new password"))
+    up.add_argument('-s', metavar='SCHEME', dest='scheme',
+                    help=_('scheme used for password hashing'))
     up.set_defaults(func=user_password, scmd='userpassword')
 
     uq = a('userquota', aliases=('uq',),