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 = {}
|
revcmd = {}
|
||||||
USAGE = None
|
USAGE = None
|
||||||
main_ins = None
|
main_ins = None
|
||||||
|
single_ins = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.env = {}
|
self.env = {}
|
||||||
@ -154,6 +155,8 @@ class ServiceManager:
|
|||||||
if cmd.startswith('PY '):
|
if cmd.startswith('PY '):
|
||||||
cmd = env.get('PY', 'python3') + cmd[2:]
|
cmd = env.get('PY', 'python3') + cmd[2:]
|
||||||
self.commands[ins] = cmd
|
self.commands[ins] = cmd
|
||||||
|
if len(self.info) == 1:
|
||||||
|
self.single_ins = list(self.info)[0]
|
||||||
self.info = result
|
self.info = result
|
||||||
|
|
||||||
#def get_cmdpats(self, groups):
|
#def get_cmdpats(self, groups):
|
||||||
@ -210,7 +213,7 @@ class ServiceManager:
|
|||||||
match = cmdpat.match(cmd)
|
match = cmdpat.match(cmd)
|
||||||
if match:
|
if match:
|
||||||
gdict = match.groupdict()
|
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', '')
|
serv = gdict.get('serv', '')
|
||||||
if cfginfo is not None and 'cfg' in gdict:
|
if cfginfo is not None and 'cfg' in gdict:
|
||||||
cfginfo[ins, serv] = gdict['cfg']
|
cfginfo[ins, serv] = gdict['cfg']
|
||||||
@ -430,6 +433,7 @@ class ServiceManager:
|
|||||||
|
|
||||||
def do_list(self, ins=None, *args):
|
def do_list(self, ins=None, *args):
|
||||||
"""info about running services"""
|
"""info about running services"""
|
||||||
|
self.get_info()
|
||||||
show_unused = ins == 'all'
|
show_unused = ins == 'all'
|
||||||
if show_unused:
|
if show_unused:
|
||||||
ins = None
|
ins = None
|
||||||
|
Reference in New Issue
Block a user