[Zope-Checkins] CVS: Zope/lib/python/Products/ZODBMountPoint - MountedObject.py:1.1.2.3

Tres Seaver tseaver at palladion.com
Fri May 20 14:37:03 EDT 2005


Update of /cvs-repository/Zope/lib/python/Products/ZODBMountPoint
In directory cvs.zope.org:/tmp/cvs-serv32014/lib/python/Products/ZODBMountPoint

Modified Files:
      Tag: Zope-2_7-branch
	MountedObject.py 
Log Message:


  - Collector #1781: made 'create_mount_points' ZConfig option actually
    work (thanks to Dieter Maurer for the patch).


=== Zope/lib/python/Products/ZODBMountPoint/MountedObject.py 1.1.2.2 => 1.1.2.3 ===
--- Zope/lib/python/Products/ZODBMountPoint/MountedObject.py:1.1.2.2	Sat Dec 20 11:58:07 2003
+++ Zope/lib/python/Products/ZODBMountPoint/MountedObject.py	Fri May 20 14:37:03 2005
@@ -115,7 +115,9 @@
     '''
     meta_type = 'ZODB Mount Point'
     _isMountedObject = 1
-    _create_mount_points = 0
+    # DM 2005-05-17: default value change necessary after fix of '_create_mount_point' handling
+    #_create_mount_points = 0
+    _create_mount_points = True
 
     icon = 'p_/broken'
     manage_options = ({'label':'Traceback', 'action':'manage_traceback'},)
@@ -165,7 +167,9 @@
         try:
             obj = root[real_root]
         except KeyError:
-            if container_class or self._create_mount_points:
+            # DM 2005-05-17: why should we require 'container_class'?
+            #if container_class or self._create_mount_points:
+            if self._create_mount_points:
                 # Create a database automatically.
                 from OFS.Application import Application
                 obj = Application()
@@ -181,7 +185,10 @@
             try:
                 obj = obj.unrestrictedTraverse(real_path)
             except (KeyError, AttributeError):
-                if container_class or self._create_mount_points:
+                # DM 2005-05-13: obviously, we do not want automatic
+                #  construction when "_create_mount_points" is false
+                #if container_class or self._create_mount_points:
+                if container_class and self._create_mount_points:
                     blazer = CustomTrailblazer(obj, container_class)
                     obj = blazer.traverseOrConstruct(real_path)
                 else:
@@ -270,7 +277,10 @@
     return res
 
 
-def manage_addMounts(dispatcher, paths=(), create_mount_points=0,
+# DM 2005-05-17: change default for 'create_mount_points' as
+#  otherwise (after our fix) 'temp_folder' can no longer be mounted
+#def manage_addMounts(dispatcher, paths=(), create_mount_points=0,
+def manage_addMounts(dispatcher, paths=(), create_mount_points=True,
                      REQUEST=None):
     """Adds MountedObjects at the requested paths.
     """
@@ -293,7 +303,9 @@
         faux.id = mo.id
         faux.meta_type = loaded.meta_type
         container._setObject(faux.id, faux)
-        del mo._create_mount_points
+        # DM 2005-05-17: we want to keep our decision about automatic
+        #  mount point creation
+        #del mo._create_mount_points
         container._setOb(faux.id, mo)
         setMountPoint(container, faux.id, mo)
         count += 1



More information about the Zope-Checkins mailing list