From bc8a874c68f376eb2be9fe71dece9cd23a70f9a5 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 4 Jul 2024 02:03:15 +0800 Subject: [PATCH] update --- plugins/mysql-yum/index.py | 5 +++-- plugins/mysql/index.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/mysql-yum/index.py b/plugins/mysql-yum/index.py index 5d994a959..904be3be9 100755 --- a/plugins/mysql-yum/index.py +++ b/plugins/mysql-yum/index.py @@ -1994,13 +1994,14 @@ def setDbSlave(version): def getMasterStatus(version=''): + if status(version) == 'stop': + return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', []) + query_status_cmd = 'show slave status' mdb8 = getMdb8Ver() if mw.inArray(mdb8, version): query_status_cmd = 'show replica status' try: - if status(version) == 'stop': - return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', []) conf = getConf() content = mw.readFile(conf) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index d4304c08b..2794a90e1 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2199,6 +2199,8 @@ def setDbSlave(version): def getMasterStatus(version=''): + if status(version) == 'stop': + return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', []) query_status_cmd = 'show slave status' mdb8 = getMdb8Ver() @@ -2206,9 +2208,7 @@ def getMasterStatus(version=''): query_status_cmd = 'show replica status' try: - if status(version) == 'stop': - return mw.returnJson(False, 'MySQL未启动,或正在启动中...!', []) - + conf = getConf() content = mw.readFile(conf) master_status = False