From: Zooko O'Whielacronx Date: Fri, 17 Aug 2007 19:06:11 +0000 (-0700) Subject: tahoe_put.py: require node-url to be provided X-Git-Url: https://git.rkrishnan.org/components/%22news.html//%22?a=commitdiff_plain;h=7e8c6eb50b1e2c5a2f6e60057b2bd8a7da11c4e9;p=tahoe-lafs%2Ftahoe-lafs.git tahoe_put.py: require node-url to be provided --- diff --git a/src/allmydata/scripts/tahoe_put.py b/src/allmydata/scripts/tahoe_put.py index 0bdc8b2b..4b0497af 100644 --- a/src/allmydata/scripts/tahoe_put.py +++ b/src/allmydata/scripts/tahoe_put.py @@ -4,15 +4,18 @@ import re, socket, sys SERVERURL_RE=re.compile("http://([^:]*)(:([1-9][0-9]*))?") -def put(serverurl, vdrive, vdrive_fname, local_fname, verbosity): +def put(nodeurl, vdrive, vdrive_fname, local_fname, verbosity): """ @param verbosity: 0, 1, or 2, meaning quiet, verbose, or very verbose @return: a Deferred which eventually fires with the exit code """ - mo = SERVERURL_RE.match(serverurl) + if not isinstance(nodeurl, basestring): + raise ValueError("nodeurl is required to be a string and look like \"http://HOSTNAMEORADDR:PORT\", not: %r" % (nodeurl,)) + + mo = SERVERURL_RE.match(nodeurl) if not mo: - raise ValueError("serverurl is required to look like \"http://HOSTNAMEORADDR:PORT\"") + raise ValueError("nodeurl is required to look like \"http://HOSTNAMEORADDR:PORT\", not: %r" % (nodeurl,)) host = mo.group(1) port = int(mo.group(3))