From 955d7abfa3d361d405f3a2492c99c4ceb367cfe8 Mon Sep 17 00:00:00 2001 From: meejah Date: Sun, 4 Mar 2018 21:52:45 -0700 Subject: [PATCH] move validation code to parser-helper --- src/allmydata/node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index a852ad4d0..4ca99422a 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -557,6 +557,10 @@ def _tub_portlocation(config): else: tubport = _convert_tub_port(cfg_tubport) + for port in tubport.split(","): + if port in ("0", "tcp:0"): + raise ValueError("tub.port cannot be 0: you must choose") + if cfg_location is None: cfg_location = "AUTO" @@ -607,8 +611,6 @@ def create_main_tub(config, tub_options, if portlocation: tubport, location = portlocation for port in tubport.split(","): - if port in ("0", "tcp:0"): - raise ValueError("tub.port cannot be 0: you must choose") if port == "listen:i2p": # the I2P provider will read its section of tahoe.cfg and # return either a fully-formed Endpoint, or a descriptor