move validation code to parser-helper

This commit is contained in:
meejah 2018-03-04 21:52:45 -07:00
parent 2517535d2b
commit 955d7abfa3

@ -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