From c9ff2350893a3451df754a240195f77c88bfb382 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 16 Apr 2016 16:27:15 +0800 Subject: [PATCH] fix(connect) input exact ip for connect modify search strategy if some ip match pass --- connect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connect.py b/connect.py index 41d7e89bd..bb7af929c 100755 --- a/connect.py +++ b/connect.py @@ -500,8 +500,9 @@ class Nav(object): except (ValueError, TypeError): # 匹配 ip, hostname, 备注 str_r = str_r.lower() - self.search_result = [asset for asset in self.perm_assets if str_r in str(asset.ip).lower() - or str_r in str(asset.hostname).lower() + self.search_result = [asset for asset in self.perm_assets if str_r == str(asset.ip).lower()] or \ + [asset for asset in self.perm_assets if str_r in str(asset.ip).lower() \ + or str_r in str(asset.hostname).lower() \ or str_r in str(asset.comment).lower()] else: # 如果没有输入就展现所有