From 846600ef9906a0055e9cb937715d0cdbbf185cba Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 2 Dec 2024 21:48:40 +0800 Subject: [PATCH] Update index.py --- plugins/migration_api/index.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/migration_api/index.py b/plugins/migration_api/index.py index 061deca92..65fc4319f 100755 --- a/plugins/migration_api/index.py +++ b/plugins/migration_api/index.py @@ -242,8 +242,7 @@ class classApi: def close_sync(self, args): # 取消迁移 mw.execShell("kill -9 {}".format(self.get_pid())) - mw.execShell( - "kill -9 $(ps aux|grep index.py|grep -v grep|awk '{print $2}')") + mw.execShell("kill -9 $(ps aux|grep index.py|grep -v grep|awk '{print $2}')") # 删除迁移配置 time.sleep(1) if os.path.exists(self._INFO_FILE): @@ -538,14 +537,14 @@ class classApi: def getSocketFile(self, mtype='mysql'): file = self.getConf(mtype) content = mw.readFile(file) - rep = 'socket\s*=\s*(.*)' + rep = r'socket\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip() def getDbPort(self, mtype='mysql'): file = self.getConf(mtype) content = mw.readFile(file) - rep = 'port\s*=\s*(.*)' + rep = r'port\s*=\s*(.*)' tmp = re.search(rep, content) return tmp.groups()[0].strip()