Revision: 8182
          http://svn.sourceforge.net/mailman/?rev=8182&view=rev
Author:   bwarsaw
Date:     2007-03-26 19:52:48 -0700 (Mon, 26 Mar 2007)

Log Message:
-----------
Fix passwords in bin/newlist.  Yes, this needs unit tests!

Modified Paths:
--------------
    trunk/mailman/Mailman/bin/newlist.py

Modified: trunk/mailman/Mailman/bin/newlist.py
===================================================================
--- trunk/mailman/Mailman/bin/newlist.py        2007-03-25 02:57:18 UTC (rev 
8181)
+++ trunk/mailman/Mailman/bin/newlist.py        2007-03-27 02:52:48 UTC (rev 
8182)
@@ -27,6 +27,7 @@
 from Mailman import Version
 from Mailman import i18n
 from Mailman import passwords
+from Mailman.bin.mmsitepass import check_password_scheme
 from Mailman.configuration import config
 from Mailman.initialize import initialize
 
@@ -74,7 +75,7 @@
 non-interactive but still send the notification, assuming listname,
 listadmin-addr and admin-password are all specified on the command line."""))
     parser.add_option('-p', '--password-scheme',
-                      default='ssha', type='string', help=_("""\
+                      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
 case-insensitive."""))
@@ -86,11 +87,9 @@
                       help=_('Alternative configuration file to use'))
     opts, args = parser.parse_args()
     if opts.list_hash_schemes:
-        for label in passwords.SCHEMES:
-            print label.upper()
+        for label in passwords.Schemes:
+            print str(label).upper()
         sys.exit(0)
-    if opts.password_scheme.lower() not in passwords.SCHEMES:
-        parser.error(_('Invalid password scheme'))
     # Can't verify opts.language here because the configuration isn't loaded
     # yet.
     return parser, opts, args
@@ -162,7 +161,8 @@
     # set available_languages.
     mlist.preferred_language = opts.language
     try:
-        pw = passwords.make_secret(listpasswd, config.PASSWORD_SCHEME)
+        scheme = check_password_scheme(parser, opts.password_scheme)
+        pw = passwords.make_secret(listpasswd, scheme)
         try:
             mlist.Create(fqdn_listname, owner_mail, pw)
         except Errors.BadListNameError, s:


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