Skip to main content

Supported options

The recipe supports the following options:

conf

Filesystem path for the configuration file. Need the complete path to the file.

zope-instances

List of filesystem paths for standalone zope instances or ZEO client instances. One path by line.

storages

List of FSS configurations for your buildout. The first line is for the global configuration. Following lines are by zope path specific configurations.

Each line is build on the below model:

name zope_path fss_strategy storage_filesystem_path backup_filesystem_path

The two first parameters are required. Others are needed sequentially: if you need to define storage_filesystem_path you have to define fss_strategy. It’s a space based configuration: don’t use spaces in parameters.

name

a name for these part of the configuration

zope_path

an absolute path in the ZODB

fss_strategy (optional)

a strategy between directory (default), flat, site1 and site2

storage_filesystem_path (optional)

filesystem path where active files are stored. Default path is $buildout_path/var/fss_storage_$name

backup_filesystem_path (optional)

filesystem path where files backup are stored. Default path is $buildout_path/var/fss_backup_$name

Example:

[fss]
recipe = iw.recipe.fss
## Deprecated
#conf = ${zopeinstance:location}/etc/plone-filesystemstorage.conf
# Replacement for 'conf' option
zope-instances =
    ${zeoclient1:location}
    ${zeoclient2:location}
storages =
# The first is always generic
    global /
# Others are always specific
    pone_flat /site flat /somewhere/files /somewhere/files_backup

Example usage

The recipe is called by buildout, let’s create an instance of it, with a buildout simulated context:

>>> from zc.buildout.testing import *
>>> import os; join = os.path.join
>>> data_dir = join(test_dir, 'data')
>>> data2_dir = join(test_dir, 'data2')
>>> bin_dir = join(data_dir, 'bin')
>>> var_dir = join(data_dir, 'var2')
>>> conf_dir = join(data_dir, 'etc')
>>> conf2_dir = join(data2_dir, 'etc')
>>> buildout = {'zeoclient1': {'location': data_dir},
...         'zeoclient2': {'location': data2_dir},
...         'buildout': {'bin-directory': bin_dir}}
>>> name = 'fss'
>>> options = {'zope-instances': '''
...        %(zeoclient1_location)s
...        %(zeoclient2_location)s
...        ''' % {'zeoclient1_location': data_dir, 'zeoclient2_location': data2_dir},
...        'storages': """
...         global /
...         storage2 /site/storage2 flat
...         storage3 /site/storage3 flat %(var)s/storage
...         storage4 /site/storage4 flat %(var)s/sub/storage %(var)s/sub/backup
...         """ % {'var': var_dir}}

Creating the recipe:

>>> from iw.recipe.fss import Recipe
>>> recipe = Recipe(buildout, name, options)

Running it:

>>> paths = list(recipe.install())

Checking files created. We don’t want this recipe to list the created dir, so in case of uninstallation, they are never removed:

>>> paths.sort()
>>> paths
['...data/etc/plone-filesystemstorage.conf', '...data2/etc/plone-filesystemstorage.conf']

Checking the conf file:

>>> conf = open(join(conf_dir,
...                  'plone-filesystemstorage.conf'))
>>> print conf.read()
# FSS conf file generated by iw.recipe.fss
<BLANKLINE>
# main storage global for /
storage-path /.../data/var/fss_storage_global
backup-path /.../data/var/fss_backup_global
storage-strategy directory
<BLANKLINE>
# storage storage2
<site /site/storage2>
 storage-path /.../data/var/fss_storage_storage2
 backup-path /.../data/var/fss_backup_storage2
 storage-strategy flat
</site>
<BLANKLINE>
# storage storage3
<site /site/storage3>
 storage-path /.../data/var2/storage
 backup-path /.../data/var/fss_backup_storage3
 storage-strategy flat
</site>
<BLANKLINE>
# storage storage4
<site /site/storage4>
 storage-path /.../sub/storage
 backup-path /.../sub/backup
 storage-strategy flat
</site>
<BLANKLINE>
<BLANKLINE>

Checking the conf file:

>>> conf = open(join(conf2_dir,
...                  'plone-filesystemstorage.conf'))
>>> print conf.read()
# FSS conf file generated by iw.recipe.fss
<BLANKLINE>
# main storage global for /
storage-path /.../data/var/fss_storage_global
backup-path /.../data/var/fss_backup_global
storage-strategy directory
<BLANKLINE>
# storage storage2
<site /site/storage2>
 storage-path /.../data/var/fss_storage_storage2
 backup-path /.../data/var/fss_backup_storage2
 storage-strategy flat
</site>
<BLANKLINE>
# storage storage3
<site /site/storage3>
 storage-path /.../data/var2/storage
 backup-path /.../data/var/fss_backup_storage3
 storage-strategy flat
</site>
<BLANKLINE>
# storage storage4
<site /site/storage4>
 storage-path /.../sub/storage
 backup-path /.../sub/backup
 storage-strategy flat
</site>
<BLANKLINE>
<BLANKLINE>

Existing data

Let’s fill the data folder with data:

>>> storage_dir = join(var_dir, 'storage')
>>> data = 'xxxx'
>>> f = open(join(storage_dir, 'data'), 'w')
>>> f.write(data)
>>> f.close()

>>> ls(storage_dir)
- data

Let’s re-run the recipe:

>>> paths = list(recipe.install())

Let’s make sure that no existing path was returned by the recipe, otherwise zc.buildout might treat them as new files. The only new file we should get is the conf file because it’s the only one that is re-written everytime:

>>> paths
['...plone-filesystemstorage.conf']

We shouldn’t loose the data:

>>> ls(storage_dir)
- data

>>> for path in paths:
...     try:
...         os.rmdir(path)
...     except:
...         os.remove(path)

Alternate configurations

Try with conf option:

>>> buildout = {'instance': {'location': data_dir},
...         'buildout': {'bin-directory': bin_dir}}
>>> name = 'fss'
>>> options = {'conf': join(conf_dir,
...                         'plone-filesystemstorage.conf'),
...        'storages': """
...         global /
...         storage2 /site/storage2 flat
...         """ % {'var': var_dir}}
>>> recipe = Recipe(buildout, name, options)
>>> paths = list(recipe.install())

Checking the conf file:

>>> conf = open(join(conf_dir,
...                  'plone-filesystemstorage.conf'))
>>> print conf.read()
# FSS conf file generated by iw.recipe.fss
<BLANKLINE>
# main storage global for /
storage-path /.../data/var/fss_storage_global
backup-path /.../data/var/fss_backup_global
storage-strategy directory
<BLANKLINE>
# storage storage2
<site /site/storage2>
 storage-path /.../data/var/fss_storage_storage2
 backup-path /.../data/var/fss_backup_storage2
 storage-strategy flat
</site>
<BLANKLINE>

Try without conf nor zope-instances option:

>>> buildout = {'instance': {'location': data_dir},
...         'buildout': {'bin-directory': bin_dir}}
>>> name = 'fss'
>>> options = {'storages': """
...         global /
...         storage2 /site/storage2 flat
...         """ % {'var': var_dir}}
>>> recipe = Recipe(buildout, name, options)
>>> paths = list(recipe.install())

Checking the conf file:

>>> conf = open(join(conf_dir,
...                  'plone-filesystemstorage.conf'))
>>> print conf.read()
# FSS conf file generated by iw.recipe.fss
<BLANKLINE>
# main storage global for /
storage-path /.../data/var/fss_storage_global
backup-path /.../data/var/fss_backup_global
storage-strategy directory
<BLANKLINE>
# storage storage2
<site /site/storage2>
 storage-path /.../data/var/fss_storage_storage2
 backup-path /.../data/var/fss_backup_storage2
 storage-strategy flat
</site>
<BLANKLINE>

Release files for iw.recipe.fss 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iw.recipe.fss 0.2.1
File Size Uploaded
iw.recipe.fss-0.2.1.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iw.recipe.fss 0.2.1
File Interpreter ABI Platform
iw.recipe.fss-0.2.1-py2.4.egg Legacy Egg format - - Details

Total release size: 21.7 kB

Release files / iw.recipe.fss-0.2.1.tar.gz

Download URL iw.recipe.fss-0.2.1.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
522d0d81165186c7776a79b85a7dbb7e5d8b888e500e4f106eb8e26eee25b07d
BLAKE2b-256 checksum
How to use checksums
ac078901b40b4fd803bf5efcac20ad78dc2233bbede9d4422fcd7f0fa51ce379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / iw.recipe.fss-0.2.1-py2.4.egg

Download URL iw.recipe.fss-0.2.1-py2.4.egg
Size 13.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
7b0578b2cecc9fd9ba672f5f530cefaaf38d789ab31a318fae764e997d363f87
BLAKE2b-256 checksum
How to use checksums
49d2c75343b249784e37832f456d6f3e0442a0dca8cfaa42275e842e30c20b89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page