added config_dirs methed to FrappyManager
This commit is contained in:
parent
4fb55323e3
commit
c7584d70b1
2
base.py
2
base.py
@ -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
|
||||
|
||||
|
16
frappyman.py
16
frappyman.py
@ -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:
|
||||
|
@ -51,8 +51,8 @@ class SeaManager(ServiceManager):
|
||||
Usage:
|
||||
|
||||
sea gui <instance>
|
||||
sea <instance> # the same as sea gui <instance>
|
||||
sea cli <instance> # the same as old seacmd
|
||||
sea <instance> # the same as sea gui <instance>
|
||||
sea cli <instance> # the same as old seacmd
|
||||
sea start <instance> [<service>]
|
||||
sea restart <instance> [<service>]
|
||||
sea stop <instance> [<service>]
|
||||
|
Loading…
x
Reference in New Issue
Block a user