Commit 6d9b35e2 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[scripts][worker] Use utils.send_multiparts to ensure data is formatted correctly

parent 2dde1a7c
......@@ -54,6 +54,7 @@ import zmq
import signal
import simplejson
import multiprocessing
try:
import Queue
except ImportError:
......@@ -68,6 +69,7 @@ from ..execution.local import LocalExecutor
from ..execution.docker import DockerExecutor
from ..dock import Host
from ..worker import WorkerController
from ..utils import send_multipart
stop = False
logger = None
......@@ -336,7 +338,7 @@ def main(user_input=None):
result['system_error']
]
socket.send_multipart(message)
send_multipart(socket, message)
execution_processes.remove(execution_process)
......@@ -384,11 +386,12 @@ def main(user_input=None):
try:
execution_process = [ p for p in execution_processes if p.job_id == job_id ][0]
except:
socket.send_multipart([
except IndexError:
parts = [
WorkerController.ERROR,
"Unknown job: %s" % job_id
])
b"Unknown job: %s" % job_id
]
send_multipart(socket, parts)
continue
# Kill the processing thread
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment