added config_dirs methed to FrappyManager

This commit is contained in:
l_samenv 2021-04-09 13:57:05 +02:00
parent 4fb55323e3
commit c7584d70b1
3 changed files with 18 additions and 4 deletions

View File

@ -230,7 +230,6 @@ class ServiceManager:
print_wait = False
continue
self.stopped[ins][service] = ' '.join(p.info['cmdline'])
done = True
break
else:
if action == 'kill':
@ -238,6 +237,7 @@ class ServiceManager:
break
continue
break
done = True
print('%s %s %s' % (ins, service, (action + 'ed').replace('eed', 'ed')))
return done

View File

@ -20,7 +20,9 @@
#
# *****************************************************************************
#import os
import sys
import os
from os.path import join
from servicemanager.base import ServiceManager, ServiceDown, UsageError
@ -39,14 +41,26 @@ class FrappyManager(ServiceManager):
%s
"""
def config_dirs(self, ins, service):
cfgpaths = []
for cfgpath in self.env[ins].get('SECOP_CONFDIR', '').split(os.pathsep):
cfgpaths.extend([join(cfgpath, service), cfgpath])
return cfgpaths
def prepare_start(self, ins, service):
start_dir, env = super().prepare_start(ins, service)
his = env.get('FRAPPY_HISTORY')
if his:
env['FRAPPY_HISTORY'] = his.replace('_SERVICE', '_' + service)
cfgpaths = self.config_dirs(ins, service)
if cfgpaths:
env['SECOP_CONFDIR'] = os.pathsep.join(cfgpaths)
print(env['SECOP_CONFDIR'])
return start_dir, env
def do_gui(self, ins='', service='main'):
start_dir, env = self.prepare_start(ins, service)
sys.path.insert(0, start_dir)
try:
self.check_running(ins, service)
except ServiceDown as e: