Skip to content

Commit 61bf500

Browse files
committed
一些组件是不能被关闭的
1 parent c39d810 commit 61bf500

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

‎kbe/tools/server/pycluster/cluster_controller.py‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
INTERFACES_TYPE = 13
3434
COMPONENT_END_TYPE = 16
3535

36-
# 组件名称转换为类别
36+
# ComponentName to type
3737
COMPONENT_NAME2TYPE = {
3838
"unknown" : UNKNOWN_COMPONENT_TYPE,
3939
"dbmgr" : DBMGR_TYPE,
@@ -51,7 +51,7 @@
5151
"interfaces" : INTERFACES_TYPE,
5252
}
5353

54-
#
54+
# Component name
5555
COMPONENT_NAME = (
5656
"unknown",
5757
"dbmgr",
@@ -69,7 +69,16 @@
6969
"interfaces",
7070
)
7171

72-
72+
# No shutdown
73+
NO_SHUTDOWN_COMPONENTS = (
74+
"interfaces",
75+
"watcher",
76+
"bots",
77+
"logger",
78+
"console",
79+
"machine",
80+
"client",
81+
)
7382

7483
class ClusterControllerHandler:
7584
def __init__(self):
@@ -469,9 +478,10 @@ def do(self):
469478
print("online-components:")
470479
printed = []
471480
for ctype in self.startTemplate:
472-
if ctype not in COMPONENT_NAME2TYPE or ctype == "machine":
473-
if(ctype != "machine"):
481+
if ctype not in COMPONENT_NAME2TYPE or ctype in NO_SHUTDOWN_COMPONENTS:
482+
if(ctype not in NO_SHUTDOWN_COMPONENTS):
474483
print("not found %s, stop failed!" % ctype)
484+
475485
continue
476486

477487
infos = interfaces.get(COMPONENT_NAME2TYPE[ctype], [])

0 commit comments

Comments
 (0)