r96395 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96394‎ | r96395 | r96396 >
Date:01:27, 7 September 2011
Author:laner
Status:deferred
Tags:
Comment:
Add missing library. Fix some variable names. Strip the password returned from the change password utility, since newlines are included in the output.
Modified paths:
  • /trunk/tools/subversion/user-management/add-labs-user (modified) (history)

Diff [purge]

Index: trunk/tools/subversion/user-management/add-labs-user
@@ -1,5 +1,5 @@
22 #!/usr/bin/python
3 -import sys, subprocess, ldapsupportlib, scriptconfig, mwclient
 3+import sys, subprocess, ldapsupportlib, scriptconfig, mwclient, urlparse
44 from optparse import OptionParser
55
66 def main():
@@ -21,10 +21,11 @@
2222 # Set a random password for the user
2323 passwdargs = ['/usr/local/sbin/change-ldap-passwd', '--random', username]
2424 passwd = subprocess.Popen(passwdargs, stdout=subprocess.PIPE).communicate()[0]
 25+ passwd = passwd.strip()
2526
2627 # Set the user's CN and email address
27 - passwdargs = ['/usr/local/sbin/modify-ldap-user', '--cn=' + options.wikiname, '--mail=' + options.mail, username]
28 - ignore = subprocess.Popen(passwdargs, stdout=subprocess.PIPE).communicate()[0]
 28+ modifyuserargs = ['/usr/local/sbin/modify-ldap-user', '--cn=' + options.wikiname, '--mail=' + options.mail, username]
 29+ ignore = subprocess.Popen(modifyuserargs, stdout=subprocess.PIPE).communicate()[0]
2930
3031 # Do an initial log in as the user, which will cause the wiki to create an account
3132 # for the user.

Status & tagging log