Skip to content

Commit 12008f5

Browse files
Alessandro Deganothelinuxer
authored andcommitted
Fix output of check and in calls.
The "check" and "in" calls now return the correct output that the Concourse JSON parser expects (a list). Moreover this commit fixes a bug appearing when the check is called: Concourse does not pass any additional arguments and thus the reading of the "workspace" value must be proteced otherwise Concourse displays an error on the check resource.
1 parent 355eeed commit 12008f5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/venv
2+
3+
#IDE
4+
.idea/

assets/resource.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ def run(self, command_name, json_data, command_arguments):
2929
data = json.loads(json_data)
3030
source = data.get('source', dict())
3131
params = data.get('params', dict())
32-
workspace = command_arguments[0]
32+
if command_arguments:
33+
workspace = command_arguments[0]
34+
else:
35+
workspace = ""
3336

3437
resource = {
3538
"in": self.in_res,
@@ -42,11 +45,11 @@ def run(self, command_name, json_data, command_arguments):
4245

4346
def check_res(self, source, params, workspace):
4447
"""Return empty version to keep Concourse happy."""
45-
return {"version": {}}
48+
return []
4649

4750
def in_res(self, source, params, workspace):
4851
"""Return empty version to keep Concourse happy."""
49-
return {"version": {}}
52+
return []
5053

5154
def out_res(self, source, params, workspace):
5255
"""Extract required params for out, construct message and send it."""

0 commit comments

Comments
 (0)