Commit 80a7463c authored by Olivier Cros's avatar Olivier Cros

Search for neo commands in path

In order to find neo commands like neoadmin, neomaster, neostorage, ... in
the path of a buildout installation, we must set the path to commands
manually.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2617 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 688f3b71
...@@ -50,11 +50,24 @@ class AlreadyRunning(Exception): ...@@ -50,11 +50,24 @@ class AlreadyRunning(Exception):
class AlreadyStopped(Exception): class AlreadyStopped(Exception):
pass pass
class NotFound(Exception):
pass
class NEOProcess(object): class NEOProcess(object):
pid = 0 pid = 0
def __init__(self, command, uuid, arg_dict): def __init__(self, command, uuid, arg_dict):
path = os.getenv('PATH')
split_path = path.split(":")
for elt_path in split_path:
command = "%s/%s" % (elt_path, command)
if os.path.exists(command):
self.command = command self.command = command
break
else:
raise NotFound, '%s not found' % (command)
self.arg_dict = arg_dict self.arg_dict = arg_dict
self.with_uuid = True self.with_uuid = True
self.setUUID(uuid) self.setUUID(uuid)
......
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