projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01a5365
)
tahoe_mv.py: use do_http, not urllib.openurl, in order to avoid connecting to the...
author
david-sarah
<david-sarah@jacaranda.org>
Wed, 10 Nov 2010 00:53:36 +0000
(16:53 -0800)
committer
david-sarah
<david-sarah@jacaranda.org>
Wed, 10 Nov 2010 00:53:36 +0000
(16:53 -0800)
src/allmydata/scripts/tahoe_mv.py
patch
|
blob
|
history
diff --git
a/src/allmydata/scripts/tahoe_mv.py
b/src/allmydata/scripts/tahoe_mv.py
index 3be219d69d8b711f55024e76ba92f9b3db189111..08618cb1f6d6971ffcdc1dd5fbe5079e96074335 100644
(file)
--- a/
src/allmydata/scripts/tahoe_mv.py
+++ b/
src/allmydata/scripts/tahoe_mv.py
@@
-28,7
+28,11
@@
def mv(options, mode="move"):
if from_path:
from_url += "/" + escape_path(from_path)
# 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)
cap = to_str(attrs.get("rw_uri") or attrs["ro_uri"])