add frappy command

- frappy(<main>, <stick>) changes main and stick (+addons) in one go
- frappy_main(..) not longer deals with standard stick
This commit is contained in:
2022-06-08 17:09:54 +02:00
parent d31a1d0e5a
commit 2974934832

View File

@ -125,6 +125,33 @@ def set_se_list():
frappy_config.set_envlist()
@usercommand
@helparglist('main [, stick [, addons]]')
def frappy(main=None, stick=None, addons=None):
"""(re)start frappy server(s) with given configs and load setup if needed
- without argument: list running frappy servers
- frappy('<cfg>'): if available, the standard stick is added too
- frappy(''): the stick is removed too
- addons are not changed when not given!
"""
if main is not None:
all_cfg = frappy_start('main', main)
if stick is None:
if main:
stickcfg = main + 'stick'
if stickcfg in FrappyNode.available_cfg('stick'):
# if a default stick is available, start this also
stick = stickcfg
else:
stick = ''
if stick is not None:
all_cfg = frappy_stick('stick', stick)
if addons is not None:
all_cfg = frappy_stick('addons', addons)
session.log.info(all_info(all_cfg))
@usercommand
@helparglist('cfg')
def frappy_main(cfg=None):
@ -133,13 +160,7 @@ def frappy_main(cfg=None):
- without argument: list running frappy servers
- cfg = "": stop frappy_main server
"""
all_cfg = frappy_start('main', cfg)
if cfg:
stickcfg = cfg + 'stick'
if stickcfg in FrappyNode.available_cfg('stick'):
# if a default stick is available, start this also
all_cfg = frappy_start('stick', stickcfg)
session.log.info(all_info(all_cfg))
session.log.info(all_info(frappy_start('main', cfg)))
@usercommand