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