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 047d1c2b815dbf7c3d3643244c5f04fa9b8d0fad..749396b3a36f9b3922c79af4c30bc487f5572594 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()