# HG changeset patch # User ft # Date 1386603500 -3600 # Node ID b97aad470500f4c850bfd6365ab19cc703b54175 # Parent cc99197f1e08fb3c14ec5b4c51fa4f209d59533c Workarround for urllib3 bug diff -r cc99197f1e08 -r b97aad470500 src/OsecFS.py --- a/src/OsecFS.py Mon Dec 09 15:19:05 2013 +0100 +++ b/src/OsecFS.py Mon Dec 09 16:38:20 2013 +0100 @@ -222,12 +222,15 @@ remote_ip = netaddr.IPNetwork("%s/%s" %(netifaces.ifaddresses("eth0")[2][0]["addr"], netifaces.ifaddresses("eth0")[2][0]["netmask"]))[1] url_options = {"type" : type, "message" : message } - url = ("http://%s:8090/notification?%s" %(remote_ip, urllib.urlencode(url_options))) + + # BUG in urllib3. Starting / is missing -> workarround use 2 of them -.- + url = ("http://%s:8090//notification?%s" %(remote_ip, urllib.urlencode(url_options))) LOG.debug ("Send notification to \"%s\"" %(url, )) try: - response = httpPool.request_encode_body('GET', url, retries = 0) + #response = httpPool.request_encode_body('GET', url, retries = 0) + response = httpPool.request("GET", url, retries = 0) except: LOG.error("Remote host not reachable") LOG.error ("Exception: %s" %(sys.exc_info()[0]))