Author: justi9
Date: 2008-04-18 15:04:57 -0400 (Fri, 18 Apr 2008)
New Revision: 1943
Modified:
mgmt/README
mgmt/cumin/bin/cumin-admin
mgmt/notes/justin-todo.txt
Log:
Update the add-user subcommand of cumin-admin. Add a password confirm
step.
Also had some success messages to add-user and remove-user.
Update the README to reflect the cumin-admin changes.
Modified: mgmt/README
===================================================================
--- mgmt/README 2008-04-18 16:29:24 UTC (rev 1942)
+++ mgmt/README 2008-04-18 19:04:57 UTC (rev 1943)
@@ -123,7 +123,9 @@
Add a cumin user:
$ cumin-admin add-user guest
- Password: # Enter a password for guest
+ Set password: # Enter a password for guest
+ Retype password: # Confirm said password
+ User 'guest' is added
USING THE DEVEL ENVIRONMENT
Modified: mgmt/cumin/bin/cumin-admin
===================================================================
--- mgmt/cumin/bin/cumin-admin 2008-04-18 16:29:24 UTC (rev 1942)
+++ mgmt/cumin/bin/cumin-admin 2008-04-18 19:04:57 UTC (rev 1943)
@@ -90,7 +90,17 @@
print "Error: a user called '%s' already exists" % name
sys.exit(1)
- password = getpass()
+ password = None
+
+ while password is None:
+ once = getpass("Set password: ")
+ twice = getpass("Retype password: ")
+
+ if once == twice:
+ password = once
+ else:
+ print "Passwords don't match; try again"
+
chs = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
crypted = crypt(password, "".join(sample(chs, 2)))
@@ -100,24 +110,28 @@
print "Error: a user called '%s' already exists" % name
sys.exit(1)
+ print "User '%s' is added" % name
elif command == "remove-user":
if config.force:
if len(args) != 2:
print "Error: no user name given"
sys.exit(1)
- accounts = ConsoleUser.selectBy(name=args[1])
+ name = args[1]
+ accounts = ConsoleUser.selectBy(name=name)
if accounts.count():
for account in accounts:
account.destroySelf()
- return
+ break
else:
print "Error: no such user '%s'" % args[1]
+ sys.exit(1)
+
+ print "User '%s' is removed" % name
else:
print "Error: command remove-user requires --force yes"
sys.exit(1)
-
elif command == "list-users":
accounts = ConsoleUser.select(orderBy='name')
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2008-04-18 16:29:24 UTC (rev 1942)
+++ mgmt/notes/justin-todo.txt 2008-04-18 19:04:57 UTC (rev 1943)
@@ -10,8 +10,6 @@
* Make it possible to navigate from broker to system
- * Update the README
-
* Fix the status box updates, to avoid the "/sec" display
* Fix obnoxious HTML resizing bug
@@ -30,10 +28,10 @@
* stat.py:222 min_value is None somehow
- * Need to prompt for password confirmation
-
* Blow up if someone adds a child with an existing name
+ * Handle parameter exceptions
+
Deferred
* Change the way CuminAction.invoke works