treat single instance of seweb / sehistory properly
there is only one seweb / sehistory instance. care has to be taken as the instrument is not part of the command
This commit is contained in:
6
base.py
6
base.py
@ -84,6 +84,7 @@ class ServiceManager:
|
||||
revcmd = {}
|
||||
USAGE = None
|
||||
main_ins = None
|
||||
single_ins = None
|
||||
|
||||
def __init__(self):
|
||||
self.env = {}
|
||||
@ -154,6 +155,8 @@ class ServiceManager:
|
||||
if cmd.startswith('PY '):
|
||||
cmd = env.get('PY', 'python3') + cmd[2:]
|
||||
self.commands[ins] = cmd
|
||||
if len(self.info) == 1:
|
||||
self.single_ins = list(self.info)[0]
|
||||
self.info = result
|
||||
|
||||
#def get_cmdpats(self, groups):
|
||||
@ -210,7 +213,7 @@ class ServiceManager:
|
||||
match = cmdpat.match(cmd)
|
||||
if match:
|
||||
gdict = match.groupdict()
|
||||
ins = gdict.get('ins', self.main_ins)
|
||||
ins = gdict.get('ins', self.main_ins) or self.single_ins
|
||||
serv = gdict.get('serv', '')
|
||||
if cfginfo is not None and 'cfg' in gdict:
|
||||
cfginfo[ins, serv] = gdict['cfg']
|
||||
@ -430,6 +433,7 @@ class ServiceManager:
|
||||
|
||||
def do_list(self, ins=None, *args):
|
||||
"""info about running services"""
|
||||
self.get_info()
|
||||
show_unused = ins == 'all'
|
||||
if show_unused:
|
||||
ins = None
|
||||
|
Reference in New Issue
Block a user