summaryrefslogtreecommitdiff
path: root/sandboxlib/utils.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-09 15:27:17 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-09 15:27:17 +0100
commit2e588565656d82689fed541a690d2c9a2e545dc1 (patch)
tree507000bfc47d868b2848a84d659c0c73d4d5d72c /sandboxlib/utils.py
parentb814d929ffba615faab7e7cbd09ecb4a01e2f50c (diff)
parente961f82127860d8efd3cfd9aa10f2cd4820d74f6 (diff)
downloadsandboxlib-0.3.0.tar.gz
Merge branch '0.3.0'0.3.0
Diffstat (limited to 'sandboxlib/utils.py')
-rw-r--r--sandboxlib/utils.py8
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')