Commit 8615d47a authored by Vincent Pelletier's avatar Vincent Pelletier

Raise when subprocess exited with an error status.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2538 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 23723929
...@@ -41,6 +41,9 @@ NEO_ADMIN = 'neoadmin' ...@@ -41,6 +41,9 @@ NEO_ADMIN = 'neoadmin'
DELAY_SAFETY_MARGIN = 10 DELAY_SAFETY_MARGIN = 10
MAX_START_TIME = 30 MAX_START_TIME = 30
class NodeProcessError(Exception):
pass
class AlreadyRunning(Exception): class AlreadyRunning(Exception):
pass pass
...@@ -117,6 +120,9 @@ class NEOProcess(object): ...@@ -117,6 +120,9 @@ class NEOProcess(object):
raise AlreadyStopped raise AlreadyStopped
result = os.WEXITSTATUS(os.waitpid(self.pid, options)[1]) result = os.WEXITSTATUS(os.waitpid(self.pid, options)[1])
self.pid = 0 self.pid = 0
if result:
raise NodeProcessError('%r %r exited with status %r' % (
self.command, self.arg_dict, result))
return result return result
def stop(self): def stop(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