fix issues with config dirs

This commit is contained in:
zolliker 2022-04-20 16:08:05 +02:00
parent 192bdca648
commit 247e660717

View File

@ -51,7 +51,7 @@ class FrappyManager(ServiceManager):
cfgparser.optionxform = str
cfgparser.read(self.env[ins]['FRAPPY_CONFIG_FILE'])
for cfgpath in cfgparser['confdir'].split(os.pathsep):
if cfgpath.endswith('SERV'):
if cfgpath.endswith('<SERV>'):
cfgpaths.append(cfgpath[:-4] + service)
else:
scfg = join(cfgpath, service)
@ -62,9 +62,10 @@ class FrappyManager(ServiceManager):
def prepare_start(self, ins, service, cfg=''):
start_dir, env = super().prepare_start(ins, service)
his = env.get('FRAPPY_HISTORY')
if his:
env['FRAPPY_HISTORY'] = his.replace('_SERVICE', '_' + service)
for key, value in env.items():
if key.startswith('FRAPPY_') and '<SERV>' in value:
env[key] = value.replace('<SERV>', service)
os.environ[key] = env[key]
cfgpaths = self.config_dirs(ins, service)
if cfgpaths:
env['FRAPPY_CONFDIR'] = os.pathsep.join(cfgpaths)