[Checkins] SVN: Products.PluggableAuthService/trunk/Products/PluggableAuthService/ - plugins/ZODBRoleManager: added logging in case searchPrincipial()

Andreas Jung andreas at andreas-jung.com
Thu Mar 6 04:09:28 EST 2008


Log message for revision 84503:
        - plugins/ZODBRoleManager: added logging in case searchPrincipial()
          returning more than one result (which might happen in case of 
          having duplicate id within difference user sources)
  
  

Changed:
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py

-=-
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt	2008-03-06 08:03:32 UTC (rev 84502)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt	2008-03-06 09:09:27 UTC (rev 84503)
@@ -8,6 +8,12 @@
         for 'startswith' test and (if the IPy module is present) IP-range
         tests.  See https://bugs.launchpad.net/zope-pas/+bug/173580 .
 
+    Bugs fixed
+
+      - plugins/ZODBRoleManager: added logging in case searchPrincipial()
+        returning more than one result (which might happen in case of 
+        having duplicate id within difference user sources)
+
   PluggableAuthService 1.5.2 (2007/11/28)
 
     Bugs fixed

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py	2008-03-06 08:03:32 UTC (rev 84502)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/ZODBRoleManager.py	2008-03-06 09:09:27 UTC (rev 84503)
@@ -37,6 +37,10 @@
 from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.utils import postonly
 
+import logging 
+
+LOG = logging.getLogger('PluggableAuthService')
+
 class IZODBRoleManager(Interface):
     """ Marker interface.
     """
@@ -271,7 +275,10 @@
 
                 parent = aq_parent( self )
                 info = parent.searchPrincipals( id=k, exact_match=True )
-                assert( len( info ) in ( 0, 1 ) )
+
+                LOG.error('searchPrincipals() returned more than one result '
+                          'id=%s' % k)
+                assert len(info) <= 1
                 if len( info ) == 0:
                     title = '<%s: not found>' % k
                 else:



More information about the Checkins mailing list