Revision: 8149
          http://svn.sourceforge.net/mailman/?rev=8149&view=rev
Author:   tkikuchi
Date:     2007-02-03 03:04:58 -0800 (Sat, 03 Feb 2007)

Log Message:
-----------
Where should etc directory belong, $prefix or $var-prefix?
I put it in $var-prefix.

mmsitepass.py ... parseargs() fails because config is not 
loaded before initialize(config).

passwords.make_secret() should be called.

Modified Paths:
--------------
    trunk/mailman/Mailman/Cgi/create.py
    trunk/mailman/Mailman/bin/mmsitepass.py
    trunk/mailman/Makefile.in

Modified: trunk/mailman/Mailman/Cgi/create.py
===================================================================
--- trunk/mailman/Mailman/Cgi/create.py 2007-01-21 15:55:21 UTC (rev 8148)
+++ trunk/mailman/Mailman/Cgi/create.py 2007-02-03 11:04:58 UTC (rev 8149)
@@ -161,7 +161,7 @@
     # We've got all the data we need, so go ahead and try to create the list
     mlist = MailList.MailList()
     try:
-        pw = passwords(password, config.PASSWORD_SCHEME)
+        pw = passwords.make_secret(password, config.PASSWORD_SCHEME)
         try:
             mlist.Create(fqdn_listname, owner, pw, langs)
         except Errors.EmailAddressError, s:

Modified: trunk/mailman/Mailman/bin/mmsitepass.py
===================================================================
--- trunk/mailman/Mailman/bin/mmsitepass.py     2007-01-21 15:55:21 UTC (rev 
8148)
+++ trunk/mailman/Mailman/bin/mmsitepass.py     2007-02-03 11:04:58 UTC (rev 
8149)
@@ -52,7 +52,7 @@
 creator is authorized to create and remove lists, but does not have
 the total power of the site administrator."""))
     parser.add_option('-p', '--password-scheme',
-                      default=config.PASSWORD_SCHEME, type='string',
+                      default='', type='string',
                       help=_("""\
 Specify the RFC 2307 style hashing scheme for passwords included in the
 output.  Use -P to get a list of supported schemes, which are
@@ -70,15 +70,23 @@
         for label in passwords.SCHEMES:
             print label.upper()
         sys.exit(0)
-    if opts.password_scheme.lower() not in passwords.SCHEMES:
-        parser.error(_('Invalid password scheme'))
     return parser, opts, args
 
 
+def check_password_scheme(parser, password_scheme):
+    # shoule be checked after config is loaded.
+    if password_scheme == '':
+        password_scheme = config.PASSWORD_SCHEME
+    if password_scheme.lower() not in passwords.SCHEMES:
+        parser.error(_('Invalid password scheme'))
+    return password_scheme
+
+
 
 def main():
     parser, opts, args = parseargs()
     initialize(opts.config)
+    opts.password_scheme = check_password_scheme(parser, opts.password_scheme)
     if args:
         password = args[0]
     else:

Modified: trunk/mailman/Makefile.in
===================================================================
--- trunk/mailman/Makefile.in   2007-01-21 15:55:21 UTC (rev 8148)
+++ trunk/mailman/Makefile.in   2007-02-03 11:04:58 UTC (rev 8149)
@@ -45,11 +45,11 @@
 CFLAGS=                @CFLAGS@ $(OPT) $(DEFS)
 
 VAR_DIRS= \
-       logs archives lists locks data spam qfiles \
+       etc logs archives lists locks data spam qfiles \
        archives/private archives/public
 
 ARCH_INDEP_DIRS= \
-       bin etc templates scripts cron pythonlib \
+       bin templates scripts cron pythonlib \
        Mailman Mailman/bin Mailman/database Mailman/Cgi Mailman/Archiver \
        Mailman/Handlers Mailman/Queue Mailman/Queue/tests \
        Mailman/Bouncers \


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to