summaryrefslogtreecommitdiff
path: root/ick2/pipelineapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-23 13:27:22 +0300
committerLars Wirzenius <liw@liw.fi>2018-04-23 15:21:39 +0300
commit9d4e01e2df83a108c2c44cc4471666b5cecf4c36 (patch)
tree272049de3e1e30f67aee4ce6304c92e349bccea0 /ick2/pipelineapi.py
parentde851333b5a0c90aa8cb7fb75e188b9e391b582d (diff)
downloadick2-9d4e01e2df83a108c2c44cc4471666b5cecf4c36.tar.gz
Change: all actions must have a "where"
Diffstat (limited to 'ick2/pipelineapi.py')
-rw-r--r--ick2/pipelineapi.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ick2/pipelineapi.py b/ick2/pipelineapi.py
index 22db2b8..da774d4 100644
--- a/ick2/pipelineapi.py
+++ b/ick2/pipelineapi.py
@@ -23,3 +23,21 @@ class PipelineAPI(ick2.ResourceApiBase):
def get_resource_name(self, resource):
return resource.get('pipeline')
+
+ def create(self, body, **kwargs):
+ resource = self.mangle_new_resource(body)
+
+ actions = resource.get('actions', [])
+ for action in actions:
+ where = action.get('where')
+ if where is None:
+ raise NoWhere(action)
+
+ return super().create(body, **kwargs)
+
+
+class NoWhere(Exception):
+
+ def __init__(self, action):
+ super().__init__(
+ 'Every action MUST specify a "where": {}'.format(action))