[Zope-Checkins] SVN: Zope/branches/2.13/ Merged r119486 from trunk:

Maurits van Rees m.van.rees at zestsoftware.nl
Mon Jan 10 19:08:11 EST 2011


Log message for revision 119487:
  Merged r119486 from trunk:
  Report success or failure (when known) of creating a new user with
  the addzope2user script.
  

Changed:
  U   Zope/branches/2.13/doc/CHANGES.rst
  U   Zope/branches/2.13/src/Products/Five/browser/tests/pages.txt
  U   Zope/branches/2.13/src/Products/Five/browser/tests/pages_ftest.txt
  U   Zope/branches/2.13/src/Products/Five/browser/tests/resource_ftest.txt
  U   Zope/branches/2.13/src/Products/Five/browser/tests/test_defaultview.py
  U   Zope/branches/2.13/src/Products/Five/browser/tests/test_menu.py
  U   Zope/branches/2.13/src/Products/Five/browser/tests/test_scriptsecurity.py
  U   Zope/branches/2.13/src/Products/Five/component/makesite.txt
  U   Zope/branches/2.13/src/Products/Five/skin/tests/test_standardmacros.py
  U   Zope/branches/2.13/src/Products/Five/viewlet/directives.txt
  U   Zope/branches/2.13/src/Zope2/Startup/zopectl.py
  U   Zope/branches/2.13/src/Zope2/utilities/adduser.py

-=-
Modified: Zope/branches/2.13/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.13/doc/CHANGES.rst	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/doc/CHANGES.rst	2011-01-11 00:08:11 UTC (rev 119487)
@@ -49,6 +49,9 @@
 Features Added
 ++++++++++++++
 
+- Report success or failure (when known) of creating a new user with
+  the addzope2user script.
+
 - Moved subset id calculation in `OFS.OrderSupport.moveObjectsByDelta` to a
   new helper method, patch by Tom Gross.
 

Modified: Zope/branches/2.13/src/Products/Five/browser/tests/pages.txt
===================================================================
--- Zope/branches/2.13/src/Products/Five/browser/tests/pages.txt	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/browser/tests/pages.txt	2011-01-11 00:08:11 UTC (rev 119487)
@@ -17,7 +17,7 @@
 wouldn't have all the rights to do traversal etc.:
 
   >>> uf = self.folder.acl_users
-  >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+  >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
   >>> self.login('manager')
 
 Now for some actual testing...

Modified: Zope/branches/2.13/src/Products/Five/browser/tests/pages_ftest.txt
===================================================================
--- Zope/branches/2.13/src/Products/Five/browser/tests/pages_ftest.txt	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/browser/tests/pages_ftest.txt	2011-01-11 00:08:11 UTC (rev 119487)
@@ -55,8 +55,8 @@
 those; we start by adding two users:
 
   >>> uf = self.folder.acl_users
-  >>> uf._doAddUser('viewer', 'secret', [], [])
-  >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+  >>> _ignored = uf._doAddUser('viewer', 'secret', [], [])
+  >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
 
   >>> protected_view_names = [
   ...     'eagle.txt', 'falcon.html', 'owl.html', 'flamingo.html',

Modified: Zope/branches/2.13/src/Products/Five/browser/tests/resource_ftest.txt
===================================================================
--- Zope/branches/2.13/src/Products/Five/browser/tests/resource_ftest.txt	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/browser/tests/resource_ftest.txt	2011-01-11 00:08:11 UTC (rev 119487)
@@ -20,7 +20,7 @@
   ...     glob.glob('%s/*.css' % _prefix))]
 
   >>> uf = self.folder.acl_users
-  >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+  >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
 
 
 Image resource

Modified: Zope/branches/2.13/src/Products/Five/browser/tests/test_defaultview.py
===================================================================
--- Zope/branches/2.13/src/Products/Five/browser/tests/test_defaultview.py	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/browser/tests/test_defaultview.py	2011-01-11 00:08:11 UTC (rev 119487)
@@ -39,7 +39,7 @@
     As a last act of preparation, we create a manager login:
 
       >>> uf = self.folder.acl_users
-      >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+      >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
 
     We can specify another default view with browser:defaultView:
 

Modified: Zope/branches/2.13/src/Products/Five/browser/tests/test_menu.py
===================================================================
--- Zope/branches/2.13/src/Products/Five/browser/tests/test_menu.py	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/browser/tests/test_menu.py	2011-01-11 00:08:11 UTC (rev 119487)
@@ -87,7 +87,7 @@
     Let's create a manager user account and log in.
 
       >>> uf = self.folder.acl_users
-      >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+      >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
       >>> self.login('manager')
       >>> newInteraction()
 

Modified: Zope/branches/2.13/src/Products/Five/browser/tests/test_scriptsecurity.py
===================================================================
--- Zope/branches/2.13/src/Products/Five/browser/tests/test_scriptsecurity.py	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/browser/tests/test_scriptsecurity.py	2011-01-11 00:08:11 UTC (rev 119487)
@@ -74,7 +74,7 @@
     Now let's create a manager user account and log in:
 
       >>> uf = self.folder.acl_users
-      >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+      >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
       >>> self.login('manager')
 
     We can now view them all:
@@ -122,7 +122,7 @@
     wouldn't have all the rights to do traversal etc.:
 
       >>> uf = self.folder.acl_users
-      >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+      >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
       >>> self.login('manager')
 
       >>> protected_view_names = [

Modified: Zope/branches/2.13/src/Products/Five/component/makesite.txt
===================================================================
--- Zope/branches/2.13/src/Products/Five/component/makesite.txt	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/component/makesite.txt	2011-01-11 00:08:11 UTC (rev 119487)
@@ -26,7 +26,7 @@
 -------------
 
     >>> uf = app.acl_users
-    >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+    >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
 
 Create the test browser we'll be using:
 

Modified: Zope/branches/2.13/src/Products/Five/skin/tests/test_standardmacros.py
===================================================================
--- Zope/branches/2.13/src/Products/Five/skin/tests/test_standardmacros.py	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/skin/tests/test_standardmacros.py	2011-01-11 00:08:11 UTC (rev 119487)
@@ -18,7 +18,7 @@
     """Test standard macros
 
       >>> uf = self.folder.acl_users
-      >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+      >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
       >>> self.login('manager')
 
       >>> from Products.Five.tests.testing import manage_addFiveTraversableFolder

Modified: Zope/branches/2.13/src/Products/Five/viewlet/directives.txt
===================================================================
--- Zope/branches/2.13/src/Products/Five/viewlet/directives.txt	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Products/Five/viewlet/directives.txt	2011-01-11 00:08:11 UTC (rev 119487)
@@ -379,7 +379,7 @@
 manager account:
 
   >>> uf = self.folder.acl_users
-  >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
+  >>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
 
 Finally, we need to setup a traversable folder.  Otherwise, Five won't
 get do its view lookup magic:

Modified: Zope/branches/2.13/src/Zope2/Startup/zopectl.py
===================================================================
--- Zope/branches/2.13/src/Zope2/Startup/zopectl.py	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Zope2/Startup/zopectl.py	2011-01-11 00:08:11 UTC (rev 119487)
@@ -420,9 +420,10 @@
             self.options.python ,
             'import Zope2; '
             'app = Zope2.app(); '
-            'app.acl_users._doAddUser(\'%s\', \'%s\', [\'Manager\'], []); '
+            'result = app.acl_users._doAddUser(\'%s\', \'%s\', [\'Manager\'], []); '
             'import transaction; '
             'transaction.commit(); '
+            'print \'Created user:\', result'
             ) % (name, password)
         os.system(cmdline)
 

Modified: Zope/branches/2.13/src/Zope2/utilities/adduser.py
===================================================================
--- Zope/branches/2.13/src/Zope2/utilities/adduser.py	2011-01-10 23:55:20 UTC (rev 119486)
+++ Zope/branches/2.13/src/Zope2/utilities/adduser.py	2011-01-11 00:08:11 UTC (rev 119487)
@@ -33,7 +33,13 @@
     finder = ZopeFinder(argv)
     finder.filter_warnings()
     app = finder.get_app()
-    adduser(app, user, pwd)
+    result = adduser(app, user, pwd)
+    if result:
+        print "User %s created." % user
+    else:
+        print "Got no result back. User creation may have failed."
+        print "Maybe the user already exists and nothing is done then."
+        print "Or the implementation does not give info when it succeeds."
 
 if __name__ == '__main__':
     main()



More information about the Zope-Checkins mailing list