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):
class AlreadyStopped(Exception):
pass
class NotFound(Exception):
pass
class NEOProcess(object):
pid = 0
def __init__(self, command, uuid, arg_dict):
self.command = command
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
break
else:
raise NotFound, '%s not found' % (command)
self.arg_dict = arg_dict
self.with_uuid = True
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