mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-18 18:56:28 +00:00
tahoe_mv.py: use do_http, not urllib.openurl, in order to avoid connecting to the webapi server via a proxy. refs #1253
This commit is contained in:
parent
01a5365051
commit
cb777ad14f
@ -28,7 +28,11 @@ def mv(options, mode="move"):
|
|||||||
if from_path:
|
if from_path:
|
||||||
from_url += "/" + escape_path(from_path)
|
from_url += "/" + escape_path(from_path)
|
||||||
# figure out the source cap
|
# figure out the source cap
|
||||||
data = urllib.urlopen(from_url + "?t=json").read()
|
resp = do_http("GET", from_url + "?t=json")
|
||||||
|
if not re.search(r'^2\d\d$', str(resp.status)):
|
||||||
|
print >>stderr, format_http_error("Error", resp)
|
||||||
|
return 1
|
||||||
|
data = resp.read()
|
||||||
nodetype, attrs = simplejson.loads(data)
|
nodetype, attrs = simplejson.loads(data)
|
||||||
cap = to_str(attrs.get("rw_uri") or attrs["ro_uri"])
|
cap = to_str(attrs.get("rw_uri") or attrs["ro_uri"])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user