Skip to main content

Recipe to configure File System Storage

Project description

What is iw.recipe.fss ?

This recipe configure FSS Storage.

How to use iw.recipe.fss ?

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

>>> import os
>>> data_dir = os.path.join(test_dir, 'data')
>>> bin_dir = os.path.join(data_dir, 'bin')
>>> var_dir = os.path.join(data_dir, 'var2')
>>> conf_dir = os.path.join(data_dir, 'etc')
>>> buildout = {'instance': {'location': data_dir},
...             'buildout': {'bin-directory': bin_dir}}
>>> name = 'fss'
>>> options = {'conf': os.path.join(conf_dir,
...                                 'plone-filesystemstorage.conf'),
...            'storages': """
...                 storage1 /site/storage1
...                 storage2 /site/storage2 flat
...                 storage2 /site/storage2 flat %s/storage %s/backup
...                 """ % (var_dir, 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:

>>> paths.sort()
>>> paths
['...data/etc/plone-filesystemstorage.conf',
 '...data/var/fss_backup_storage1',
 '...data/var/fss_backup_storage2',
 '...data/var/fss_storage_storage1',
 '...data/var/fss_storage_storage2',
 '...data/var2/backup',
 '...data/var2/storage']

Checking the conf file:

>>> conf = open(os.path.join(conf_dir,
...                          'plone-filesystemstorage.conf'))
>>> print conf.read()
# FSS conf file generated by iw.recipe.fss
<BLANKLINE>
<BLANKLINE>
 # storage storage1
 <site /site/storage1>
   storage-path /.../data/var/fss_storage_storage1
   backup-path ...data/var/fss_backup_storage1
   storage-strategy directory
</site>
<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 storage2
<site /site/storage2>
  storage-path ...data/var2/storage
  backup-path ...data/var2/backup
  storage-strategy flat
</site>
<BLANKLINE>

Cleaning up the files:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

iw.recipe.fss-0.1dev_r6469-py2.5.egg (10.6 kB view details)

Uploaded Source

iw.recipe.fss-0.1dev_r6469-py2.4.egg (10.6 kB view details)

Uploaded Source

File details

Details for the file iw.recipe.fss-0.1dev_r6469-py2.5.egg.

File metadata

File hashes

Hashes for iw.recipe.fss-0.1dev_r6469-py2.5.egg
Algorithm Hash digest
SHA256 5e7d45691cbfcf50cc908c8313aec55aaad4f1ccbed3986b5f35232150c22375
MD5 901cfdc568d07e6dc8c5ad5ccf9edb3e
BLAKE2b-256 d7fe363f208620e94cba3f839a2c7af542f9fc704919da4eca6d47b121b75be3

See more details on using hashes here.

File details

Details for the file iw.recipe.fss-0.1dev_r6469-py2.4.egg.

File metadata

File hashes

Hashes for iw.recipe.fss-0.1dev_r6469-py2.4.egg
Algorithm Hash digest
SHA256 e81ec93dbbee1d915e2963e36689117da72a312f4b986ea8ea98ea2744de5427
MD5 8cbb8175bdaeb3464762edd072e22b40
BLAKE2b-256 bd9640dbc371b7e226f9438812f2e6ee980653974f259bd7a83f5a28dca933ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page