Skip to main content

Buildout recipe to check various dependencies are in place.

Project description

Dependency checker buildout recipe

If you are relying on the OS to provide some facilities for your software, this recipe can help verify that the dependencies exist.

The recipe can check for any of the following:

  • If certain files exist in the filesystem and that they are executable

  • If certain locales are available on the system

  • If buildout is being run as a particular user

  • If certain users are present on the system

  • If buildout is being run by any of a list of python versions

Note that locales are checked in an Ubuntu-specific way, so may not work for you.

If any dependencies fail, and the “action” option isn’t set to “warn”, the recipe will raise an exception.

An example:

[foo]
program = /usr/sbin/foo

[bar]
binary = /usr/sbin/bar
locale = nl_NL.UTF-8

[dependencies]
recipe = isotoma.recipe.depcheck
executable =
    ${foo:program}
    ${bar:binary}
locale = ${bar:locale}
current-user = webappuser
users =
    taskqueue
    www-data
python =
    2.5
    2.6
    2.7
action = warn

Parameters

executable

A list of one or more paths to files that must be executable

directory

A list of one or more paths to inodes that must exist and be directories

file

A list of one or more paths to inodes that must exist and be files

locale-file

The name of a file on disk to look for locales in (defaults to the Ubuntu location)

locale

A list of one or more locales to check are in locale-file

current-user

Ensures that buildout is being run by the user specified.

users

A list of users that must have accounts on the local system. (Users must be present in /etc/passwd)

python

A list of python versions that buildout be executed under (useful if your application is py2.4-only, etc.)

action

Either “warn” or “fail”. The default is to “fail” if a dependency isn’t met.

License

Copyright 2010 Isotoma Limited

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Changelog

0.0.9 (2014-11-20)

  • Fix support for older pythons.

0.0.8 (2014-11-20)

  • Use the output of locales command if required.

0.0.7 (2013-01-15)

  • Checking for executables would error out if the file was missing. Now only tries to stat the file if it is there.

0.0.6 (2012-04-08)

  • Nothing changed yet.

0.0.5 (2011-09-09)

  • The locale option was opening and parsing the (ubuntu) locales file each time the recipe was run, regardless of whether or not the user specified “locale =” Now it doesn’t.

0.0.4 (2011-09-07)

  • Check dependencies when the recipe’s __init__ method is called, not the install method, so that dependency checks are run as early as possible.

0.0.3 (2011-09-06)

  • Report on all dependency requirements prior to raising a UserError

  • The buildout-created bin/test now runs the unit recipe’s unit tests

  • Added option “action = warn” (default is “action = fail”) to just alert the user to dependency failures, but allow the buildout to continue.

  • Added option “current-user”, to ensure that the buildout is being run as the required system user, e.g. “django”.

  • Added option “users” to ensure that particular users are present on the system WARNING however that this retrieves its user list from /etc/passwd, so LDAP and the likes are not supported.

  • Added option “python” to check that the correct python version is being used. Multiple python versions are allowed, one-per-line. Only major and minor version numbers are accounted for, i.e. 2.6, NOT 2.6.3.

0.0.2 (2011-08-16)

  • Better error handling

Project details


Download files

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

Source Distribution

isotoma.recipe.depcheck-0.0.9.zip (13.3 kB view details)

Uploaded Source

File details

Details for the file isotoma.recipe.depcheck-0.0.9.zip.

File metadata

File hashes

Hashes for isotoma.recipe.depcheck-0.0.9.zip
Algorithm Hash digest
SHA256 75a362b87e1f53d56b097989d76459851a4cc8f50182870830f43043fe1f4451
MD5 22ea5fe8566f47756b7cddaa55d9dc40
BLAKE2b-256 b307b7e222ab43b8f8862be02d70e4c17241031fbb6370eafdb9446572dac94e

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