summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2014-01-14 00:44:04 -0500
committerGui Chen <gui.chen@intel.com>2014-01-14 06:16:04 -0500
commit7a3e7c77495b469dccec68a480f2c161980912c1 (patch)
tree774d1fb44cdeca3f38979d92f74153a468c3da1e
parent65a53c2bba4c098cb9831e8ca674aeb772418347 (diff)
downloadmic-7a3e7c77495b469dccec68a480f2c161980912c1.tar.gz
mic-7a3e7c77495b469dccec68a480f2c161980912c1.tar.bz2
mic-7a3e7c77495b469dccec68a480f2c161980912c1.zip
fix single ip ignored in no proxy setting
Fixes: #1569 Change-Id: Ic40c32ceaed78e59947af7f185e00e84ccbb30b8 Signed-off-by: Gui Chen <gui.chen@intel.com>
-rw-r--r--mic/utils/proxy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mic/utils/proxy.py b/mic/utils/proxy.py
index 91451a2..c1fb94f 100644
--- a/mic/utils/proxy.py
+++ b/mic/utils/proxy.py
@@ -16,6 +16,7 @@
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os
+import re
import urlparse
_my_proxies = {}
@@ -145,7 +146,7 @@ def _isnoproxy(url):
hostisip = _isip(host)
for item in _my_noproxy_list:
- if hostisip and item["match"] <= 1:
+ if hostisip and item["match"] == 1:
continue
if item["match"] == 2 and hostisip:
@@ -157,7 +158,7 @@ def _isnoproxy(url):
return True
if item["match"] == 1:
- if host.rfind(item["needle"]) > 0:
+ if re.match(r".*%s$" % item["needle"], host):
return True
return False