use general config file instead of SECOP_CONF
for getting the config directories
This commit is contained in:
parent
f411460c2c
commit
192bdca648
10
frappyman.py
10
frappyman.py
@ -47,7 +47,10 @@ class FrappyManager(ServiceManager):
|
||||
|
||||
def config_dirs(self, ins, service):
|
||||
cfgpaths = []
|
||||
for cfgpath in self.env[ins].get('SECOP_CONFDIR', '').split(os.pathsep):
|
||||
cfgparser = ConfigParser()
|
||||
cfgparser.optionxform = str
|
||||
cfgparser.read(self.env[ins]['FRAPPY_CONFIG_FILE'])
|
||||
for cfgpath in cfgparser['confdir'].split(os.pathsep):
|
||||
if cfgpath.endswith('SERV'):
|
||||
cfgpaths.append(cfgpath[:-4] + service)
|
||||
else:
|
||||
@ -58,16 +61,13 @@ class FrappyManager(ServiceManager):
|
||||
return cfgpaths
|
||||
|
||||
def prepare_start(self, ins, service, cfg=''):
|
||||
import os
|
||||
import sys
|
||||
|
||||
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)
|
||||
env['FRAPPY_CONFDIR'] = os.pathsep.join(cfgpaths)
|
||||
return start_dir, env
|
||||
|
||||
def do_start(self, ins, service=None, cfg='', restart=False, wait=False, logger=None):
|
||||
|
Loading…
x
Reference in New Issue
Block a user