From 55a10a8d1df0d71287f5a15b0bed25d7e71ef2e6 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Thu, 22 Sep 2022 19:18:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20DBPortManger=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=20port=20=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/utils/db_port_mapper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/terminal/utils/db_port_mapper.py b/apps/terminal/utils/db_port_mapper.py index d485aaf81..a2874e334 100644 --- a/apps/terminal/utils/db_port_mapper.py +++ b/apps/terminal/utils/db_port_mapper.py @@ -60,6 +60,10 @@ class DBPortManager(object): ) def get_db_by_port(self, port): + try: + port = int(port) + except Exception as e: + raise JMSException('Port type error: {}'.format(e)) mapper = self.get_mapper() db_id = mapper.get(port, None) if not db_id: