3 from allmydata.scripts.common_http import do_http, format_http_success, format_http_error
4 from allmydata.scripts.common import get_alias, DEFAULT_ALIAS, escape_path, \
9 @return: a Deferred which eventually fires with the exit code
11 nodeurl = options['node-url']
12 aliases = options.aliases
14 stdout = options.stdout
15 stderr = options.stderr
17 if nodeurl[-1] != "/":
20 rootcap, path = get_alias(aliases, where, DEFAULT_ALIAS)
21 except UnknownAliasError, e:
25 url = nodeurl + "uri/%s" % urllib.quote(rootcap)
26 url += "/" + escape_path(path)
28 resp = do_http("DELETE", url)
30 if resp.status in (200,):
31 print >>stdout, format_http_success(resp)
34 print >>stderr, format_http_error("ERROR", resp)