mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-12 07:13:53 +00:00
tahoe_put.py: require node-url to be provided
This commit is contained in:
parent
3c95b1ab58
commit
7e8c6eb50b
@ -4,15 +4,18 @@ import re, socket, sys
|
|||||||
|
|
||||||
SERVERURL_RE=re.compile("http://([^:]*)(:([1-9][0-9]*))?")
|
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
|
@param verbosity: 0, 1, or 2, meaning quiet, verbose, or very verbose
|
||||||
|
|
||||||
@return: a Deferred which eventually fires with the exit code
|
@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:
|
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)
|
host = mo.group(1)
|
||||||
port = int(mo.group(3))
|
port = int(mo.group(3))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user