summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-02-01 11:21:55 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-02-01 11:21:55 +0100
commitc1a3ccf5991da52552220aaec4b58a9f12b1e468 (patch)
treedc85d4beefe10c3105bf047165e3ace46e222d47
parentalso accept a single pattern (diff)
sanity check for worker names and sub-names
-rwxr-xr-xsrc/flufigut.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flufigut.py b/src/flufigut.py
index c266287..8decd90 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -48,6 +48,11 @@ def rand_string(size=8, chars=string.ascii_lowercase + string.ascii_uppercase +
class Worker:
def __init__(self, name, subname=None):
+ if ':' in name:
+ raise Exception("worker name '%s' is invalid (must not contain ':')" % name)
+ if subname and ':' in subname:
+ raise Exception("worker sub-name '%s' of worker '%s' is invalid (must not contain ':')" % (subname, name))
+
self.name = name
self.subname = subname