From: Daira Hopwood Date: Mon, 9 Feb 2015 19:18:58 +0000 (+0000) Subject: Allow combining autodetected and statically configured locations. fixes #754 X-Git-Tag: allmydata-tahoe-1.10.1a1~70^2~5 X-Git-Url: https://git.rkrishnan.org/something?a=commitdiff_plain;h=c9a56eae2b03221b4399a3b801510a10a1f6e9a1;p=tahoe-lafs%2Ftahoe-lafs.git Allow combining autodetected and statically configured locations. fixes #754 Replaces the location 'AUTO' with the autodetected IP/port combination. Author: Chris Kerr Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 710ce7d5..ab8722af 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -398,9 +398,16 @@ class Node(service.MultiService): # next time fileutil.write_atomically(self._portnumfile, "%d\n" % portnum, mode="") - base_location = ",".join([ "%s:%d" % (addr, portnum) - for addr in local_addresses ]) - location = self.get_config("node", "tub.location", base_location) + location = self.get_config("node", "tub.location", "AUTO") + + # Replace the location "AUTO" with the detected local addresses. + split_location = location.split(",") + if "AUTO" in split_location: + split_location.remove("AUTO") + split_location.extend([ "%s:%d" % (addr, portnum) + for addr in local_addresses ]) + location = ",".join(split_location) + self.log("Tub location set to %s" % location) self.tub.setLocation(location)