diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-06-09 15:27:17 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-06-09 15:27:17 +0100 |
commit | 2e588565656d82689fed541a690d2c9a2e545dc1 (patch) | |
tree | 507000bfc47d868b2848a84d659c0c73d4d5d72c /sandboxlib/utils.py | |
parent | b814d929ffba615faab7e7cbd09ecb4a01e2f50c (diff) | |
parent | e961f82127860d8efd3cfd9aa10f2cd4820d74f6 (diff) | |
download | sandboxlib-0.3.0.tar.gz |
Merge branch '0.3.0'0.3.0
Diffstat (limited to 'sandboxlib/utils.py')
-rw-r--r-- | sandboxlib/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sandboxlib/utils.py b/sandboxlib/utils.py index af5fe3e..b3ec867 100644 --- a/sandboxlib/utils.py +++ b/sandboxlib/utils.py @@ -22,6 +22,14 @@ import sys import sandboxlib +def check_parameter(name, value, supported_values): + assert value in supported_values, \ + "'%(value)s' is an unsupported value for '%(name)s' in this " \ + "backend. Supported values: %(supported_values)s".format( + name=name, value=value, + supported_values=', '.join(supported_values)) + + def find_program(program_name): search_path = os.environ.get('PATH') |