Skip to content

Commit 3d21056

Browse files
Fixed missing import and improved scripts call.
1 parent 63ca426 commit 3d21056

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

webhooks.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from hashlib import sha1
2020
from json import loads, dumps
2121
from shlex import split as shsplit
22+
from subprocess import Popen, PIPE
2223
from os import access, X_OK
2324
from os.path import isfile, abspath, normpath, dirname, join
2425

@@ -96,11 +97,17 @@ def index():
9697
ran = {}
9798
for s in scripts:
9899
if isfile(s) and access(s, X_OK):
99-
ret = call(
100+
cmd = Popen(
100101
shsplit("{} '{}'".format(s, dumps(payload))),
101-
shell=True
102+
shell=True,
103+
stdout=PIPE, stderr=PIPE
102104
)
103-
ran[basename(s)] = ret
105+
stdout, stderr = cmd.communicate()
106+
ran[basename(s)] = {
107+
'returncode': returncode,
108+
'stdout': stdout,
109+
'stderr': stderr,
110+
}
104111

105112
return ran
106113

0 commit comments

Comments
 (0)