From 6ea168499598d0d02262d8bb11eb58e7d19929e4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Tue, 16 Apr 2019 11:26:42 -0400 Subject: [PATCH] use listenOnUnused instead of allocate_tcp_port in create_control_tub --- src/allmydata/node.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 9ed55bef4..80ee1fa5a 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -680,12 +680,8 @@ def create_control_tub(): port or location """ control_tub = Tub() - portnum = iputil.allocate_tcp_port() - port = "tcp:%d:interface=127.0.0.1" % portnum - location = "tcp:127.0.0.1:%d" % portnum - control_tub.listenOn(port) - control_tub.setLocation(location) - log.msg("Control Tub location set to %s" % (location,)) + portnum = iputil.listenOnUnused(control_tub) + log.msg("Control Tub location set to 127.0.0.1:%s" % (portnum,)) return control_tub