Add an option to not error out when only a local IP address can be found.
[quix0rs-apt-p2p.git] / apt_dht / apt_dht.py
index 047d1c2..749396b 100644 (file)
@@ -42,7 +42,9 @@ class AptDHT:
         return self.http_site
     
     def joinComplete(self, result):
-        self.my_addr = findMyIPAddr(result, config.getint(config.get('DEFAULT', 'DHT'), 'PORT'))
+        self.my_addr = findMyIPAddr(result,
+                                    config.getint(config.get('DEFAULT', 'DHT'), 'PORT'),
+                                    config.getboolean('DEFAULT', 'LOCAL_OK'))
         if not self.my_addr:
             raise RuntimeError, "IP address for this machine could not be found"
         self.cache.scanDirectories()