[mirrorbrain-commits] r7785 - /trunk/mirrordoctor/mirrordoctor.py

From: <poeml_at_mirrorbrain.org>
Date: Fri, 04 Sep 2009 10:43:35 -0000
Author: poeml
Date: Fri Sep  4 12:43:34 2009
New Revision: 7785

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7785&view=rev
Log:
mb new:
- when adding new mirrors, the hostname part in the HTTP base URL might contain
  a port number. This is now recognized correctly, so the DNS lookup, GeoIP
  lookup and ASN lookup for the hostname string can work.

Modified:
    trunk/mirrordoctor/mirrordoctor.py

Modified: trunk/mirrordoctor/mirrordoctor.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mirrordoctor.py?rev=7785&r1=7784&r2=7785&view=diff
==============================================================================
--- trunk/mirrordoctor/mirrordoctor.py (original)
+++ trunk/mirrordoctor/mirrordoctor.py Fri Sep  4 12:43:34 2009
@@ -156,6 +156,8 @@
             sys.exit('An HTTP base URL needs to be specified')
 
         scheme, host, path, a, b, c = urlparse.urlparse(opts.http)
+        if ':' in host:
+            host, port = host.split(':')
         if not opts.region:
             opts.region = mb.geoip.lookup_region_code(host)
         if not opts.country:




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Fri Sep 04 2009 - 10:43:37 GMT

This archive was generated by hypermail 2.2.0 : Fri Sep 04 2009 - 10:45:12 GMT