[Checkins] SVN: Products.PluggableAuthService/trunk/Products/PluggableAuthService/ o add metadata.xml version to GS profiles

Rob Miller ra at burningman.com
Tue Jun 10 22:11:16 EDT 2008


Log message for revision 87308:
  o add metadata.xml version to GS profiles
  o don't fail if ZODBRoleManagerExportImport tries to add a role that already
    exists
  

Changed:
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/exportimport.py
  A   Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/empty/metadata.xml
  A   Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/simple/metadata.xml

-=-
Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt	2008-06-11 02:01:50 UTC (rev 87307)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/doc/CHANGES.txt	2008-06-11 02:11:15 UTC (rev 87308)
@@ -17,6 +17,9 @@
         returning more than one result (which might happen in case of 
         having duplicate id within difference user sources)
 
+      - Ensure ZODBRoleManagerExportImport doesn't fail if it tries to add a
+        role that already exists (idempotence is desirable in GS importers)
+
   PluggableAuthService 1.5.2 (2007/11/28)
 
     Bugs fixed

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/exportimport.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/exportimport.py	2008-06-11 02:01:50 UTC (rev 87307)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/exportimport.py	2008-06-11 02:11:15 UTC (rev 87308)
@@ -241,7 +241,11 @@
             title = self._getNodeAttr(role, 'title', None)
             description = self._getNodeAttr(role, 'description', None)
 
-            self.context.addRole(role_id, title, description)
+            try:
+                self.context.addRole(role_id, title, description)
+            except KeyError:
+                # it's fine if the role already exists
+                pass
 
             for principal in role.getElementsByTagName('principal'):
                 principal_id = self._getNodeAttr(principal, 'principal_id', None)

Copied: Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/empty/metadata.xml (from rev 87307, Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/profiles/empty/metadata.xml)
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/empty/metadata.xml	                        (rev 0)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/empty/metadata.xml	2008-06-11 02:11:15 UTC (rev 87308)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1.6.0</version>
+</metadata>

Copied: Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/simple/metadata.xml (from rev 87307, Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/profiles/simple/metadata.xml)
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/simple/metadata.xml	                        (rev 0)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/profiles/simple/metadata.xml	2008-06-11 02:11:15 UTC (rev 87308)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1.6.0</version>
+</metadata>



More information about the Checkins mailing list