diff -ru ./collective/recipe/filestorage/__init__.py /home/zope/instances/fixing-filestorage-recipe/testfs/eggs/collective.recipe.filestorage-0.3-py2.4.egg/collective/recipe/filestorage/__init__.py --- ./collective/recipe/filestorage/__init__.py 2009-07-27 08:22:49.000000000 +0000 +++ /home/zope/instances/fixing-filestorage-recipe/testfs/eggs/collective.recipe.filestorage-0.3-py2.4.egg/collective/recipe/filestorage/__init__.py 2009-08-24 09:31:07.000000000 +0000 @@ -122,7 +122,25 @@ zodb_cache_size = self._subpart_option(subpart, 'zodb-cache-size', default='5000', inherit=zope_part) zodb_name = self._subpart_option(subpart, 'zodb-name', default='%(fs_part_name)s') - zodb_mountpoint = self._subpart_option(subpart, 'zodb-mountpoint', default='/%(fs_part_name)s') + # BBB: a zodb-mountpoint directive will override other directives. + zodb_mountpoint = self._subpart_option(subpart, 'zodb-mountpoint', default='') + if zodb_mountpoint: + print 'Found zodb-mountpoint for %s, will ignore other mounting directives.' % subpart + zodb_mounted_object = zodb_mountpoint + else: + zodb_mounted_object = self._subpart_option(subpart, 'zodb-mounted-object', default='/%(fs_part_name)s') + dirname, basename = os.path.split(zodb_mounted_object) + zodb_mountpoint_container = self._subpart_option(subpart, 'zodb-mountpoint-container', default=dirname) + zodb_realhome = self._subpart_option(subpart, 'zodb-realhome', default='') + if zodb_realhome: + zodb_mountpoint = '%s:~%s/%s' % ( + os.path.join(zodb_mountpoint_container, basename), + zodb_realhome, + zodb_mounted_object) + else: + zodb_mountpoint = '%s:%s' % ( + os.path.join(zodb_mountpoint_container, basename), + zodb_mounted_object) zodb_container_class = self._subpart_option(subpart, 'zodb-container-class', default='') if zodb_container_class: zodb_container_class = "\ncontainer-class %s" % zodb_container_class @@ -151,7 +169,7 @@ zeo_conf_additional = zeo_options.get('zeo-conf-additional', '') zeo_options['zeo-conf-additional'] = zeo_conf_additional + storage_snippet - def _subpart_option(self, subpart, option, default=None, inherit=()): + def _subpart_option(self, subpart, option, default='', inherit=()): """ Retrieve an option for a filestorage subpart, perhaps falling back to other specified parts. Also substitutes the name of the subpart. """ @@ -197,4 +215,4 @@ %(storage_snippet)s mount-point %(zodb_mountpoint)s%(zodb_container_class)s -""" \ No newline at end of file +""" diff -ru ./collective/recipe/filestorage/README.txt /home/zope/instances/fixing-filestorage-recipe/testfs/eggs/collective.recipe.filestorage-0.3-py2.4.egg/collective/recipe/filestorage/README.txt --- ./collective/recipe/filestorage/README.txt 2009-07-27 08:22:49.000000000 +0000 +++ /home/zope/instances/fixing-filestorage-recipe/testfs/eggs/collective.recipe.filestorage-0.3-py2.4.egg/collective/recipe/filestorage/README.txt 2009-08-24 10:34:46.000000000 +0000 @@ -34,7 +34,18 @@ Set the ZODB cache size, i.e. the number of objects which the ZODB cache will try to hold. Inherits from the associated zope part. Defaults to 5000. zodb-mountpoint - Set the path to the mountpoint. Defaults to '/%(fs_part_name)s'. + Directly specify the 'mount-point' directive as documented in 'zopeschema.xml'. + If you use this option, the next three options are ignored. +zodb-mounted-object + Set the path to the object to be mounted from the named filestorage. + Defaults to '/%(fs_part_name)s'. +zodb-mountpoint-container + Set the path to the container where the mountpoint should be created. + e.g. '/mnt/'. Defaults to the path of the mounted object; i.e. if + zodb-mounted-object is '/sites/%(fs_part_name)s', then + zodb-mountpoint-container will be '/sites/'. +zodb-realhome + Normally doesn't need to be changed. See 'zopeschema.xml'. zodb-container-class Set the class of the object being mounted. Defaults to not being set. zeo-address