add sea config information to sea list
+ fixed servman import (must be __init__)
This commit is contained in:
15
__init__.py
15
__init__.py
@ -154,12 +154,12 @@ class ServiceManager:
|
||||
self.get_info()
|
||||
return self.info[ins]
|
||||
|
||||
#def get_cfg(self, service, cmd):
|
||||
# """return info about running program, if relevant
|
||||
#
|
||||
# example for frappy: return cfg
|
||||
# """
|
||||
# return ''
|
||||
def get_cfg(self, service):
|
||||
"""return cfg info about running programs, if relevant
|
||||
|
||||
example for sea: return samenv name
|
||||
"""
|
||||
return ''
|
||||
|
||||
def get_procs(self, groups=None, cfginfo=None):
|
||||
"""return processes
|
||||
@ -364,11 +364,12 @@ class ServiceManager:
|
||||
for serv, port in info_grp.items():
|
||||
plist = procs_dict.get(serv)
|
||||
if plist:
|
||||
cfg = cfginfo.get((ins_i, serv), '') or sm.get_cfg(serv)
|
||||
if sm == self:
|
||||
show_ins = True
|
||||
gs = '%s %s' % (group, serv)
|
||||
port = str(port or '')
|
||||
run_info.append(('', gs, port, cfginfo.get((ins_i, serv), '')))
|
||||
run_info.append(('', gs, port, cfg))
|
||||
if len(plist) > 1:
|
||||
rows.append(['', ' WARNING: multiple processes %s'
|
||||
% ', '.join(str(p.pid) for p, _ in plist)])
|
||||
|
@ -21,7 +21,7 @@
|
||||
# *****************************************************************************
|
||||
|
||||
import re
|
||||
from servman import ServiceManager
|
||||
from __init__ import ServiceManager
|
||||
|
||||
|
||||
class FrappyManager(ServiceManager):
|
||||
|
2
nicos.py
2
nicos.py
@ -26,7 +26,7 @@ import shutil
|
||||
from glob import glob
|
||||
from os.path import join, abspath, dirname, expanduser, exists, islink
|
||||
from configparser import ConfigParser
|
||||
from servman import ServiceManager
|
||||
from __init__ import ServiceManager
|
||||
|
||||
|
||||
ENV_KEYS = {
|
||||
|
13
sea.py
13
sea.py
@ -24,7 +24,8 @@ import sys
|
||||
import time
|
||||
import termios
|
||||
import subprocess
|
||||
from servman import ServiceManager, ServiceDown
|
||||
from __init__ import ServiceManager, ServiceDown
|
||||
from sicsclient import sics_command
|
||||
|
||||
|
||||
def run_command(cmd, wait=False):
|
||||
@ -70,3 +71,13 @@ class SeaManager(ServiceManager):
|
||||
run_command('SeaClient %s' % ins)
|
||||
print('starting sea gui %s' % ins)
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
def get_cfg(self, service):
|
||||
"""return cfg info about running programs, if relevant
|
||||
|
||||
example for sea: return samenv name
|
||||
"""
|
||||
if service != 'sea': # ignore when service == 'graph'
|
||||
try:
|
||||
return sics_command(('localhost', self.info['sea']['port']), 'samenv name')
|
||||
|
Reference in New Issue
Block a user