Commit 93b5fe85 authored by Martín Ferrari's avatar Martín Ferrari

Check slave banner before returning

parent afde80a6
...@@ -65,6 +65,9 @@ class SlaveNode(object): ...@@ -65,6 +65,9 @@ class SlaveNode(object):
ppid = os.getpid() ppid = os.getpid()
pid = os.fork() pid = os.fork()
if pid: if pid:
helo = s0.recv(4096).rstrip().split(None, 1)
if int(helo[0]) / 100 != 2:
raise RuntimeError("Failed to start slave node: %s" % helo[1])
self.pid = pid self.pid = pid
self.sock = s0 self.sock = s0
s1.close() s1.close()
...@@ -76,7 +79,8 @@ class SlaveNode(object): ...@@ -76,7 +79,8 @@ class SlaveNode(object):
self.ppid = ppid self.ppid = ppid
self.run() self.run()
except BaseException, e: except BaseException, e:
sys.stderr.write("Error in slave node: %s\n" % str(e)) s1.send("500 %s\n" % str(e))
sys.stderr.write("Error starting slave node: %s\n" % str(e))
os._exit(1) os._exit(1)
os._exit(0) os._exit(0)
def run(self): def run(self):
......
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