try to fix the case the *_ROOT dir is not in sys.path
This commit is contained in:
7
base.py
7
base.py
@@ -302,7 +302,10 @@ class ServiceManager:
|
||||
if not ins:
|
||||
raise UsageError('need instance')
|
||||
env = self.env[ins]
|
||||
return env.get('%s_ROOT' % gr, ''), env
|
||||
startdir = env.get('%s_ROOT' % gr, '')
|
||||
if startdir not in sys.path:
|
||||
sys.path.insert(0, startdir)
|
||||
return startdir, env
|
||||
|
||||
def do_start(self, ins, service=None, cfg='', restart=False, wait=False, logger=None, opts=''):
|
||||
if not ins:
|
||||
@@ -367,8 +370,6 @@ class ServiceManager:
|
||||
start_dir, env = self.prepare_start(ins, service_i, cfg)
|
||||
env = dict(os.environ, **env, Instrument=ins)
|
||||
os.chdir(start_dir)
|
||||
if start_dir not in sys.path:
|
||||
sys.path.insert(0, start_dir)
|
||||
nicosenv = '/home/nicos/nicos/nicosenv/bin/'
|
||||
if exists(nicosenv):
|
||||
env['PATH'] = f"{nicosenv}:{env['PATH']}"
|
||||
|
||||
Reference in New Issue
Block a user