From: kevan Date: Mon, 20 Jul 2009 03:48:31 +0000 (-0700) Subject: Alter filenode.py to use parse_replace_arg X-Git-Tag: allmydata-tahoe-1.5.0~30 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer?a=commitdiff_plain;h=74207d8334dc0340a9dfb21c24766080fe418cab;p=tahoe-lafs%2Ftahoe-lafs.git Alter filenode.py to use parse_replace_arg --- diff --git a/src/allmydata/web/filenode.py b/src/allmydata/web/filenode.py index 05c12279..9b2c4535 100644 --- a/src/allmydata/web/filenode.py +++ b/src/allmydata/web/filenode.py @@ -15,7 +15,7 @@ from allmydata.util import log, base32 from allmydata.web.common import text_plain, WebError, RenderMixin, \ boolean_of_arg, get_arg, should_create_intermediate_directories, \ - MyExceptionHandler + MyExceptionHandler, parse_replace_arg from allmydata.web.check_results import CheckResults, \ CheckAndRepairResults, LiteralCheckResults from allmydata.web.info import MoreInfo @@ -109,7 +109,8 @@ class PlaceHolderNodeHandler(RenderMixin, rend.Page, ReplaceMeMixin): def render_PUT(self, ctx): req = IRequest(ctx) t = get_arg(req, "t", "").strip() - replace = boolean_of_arg(get_arg(req, "replace", "true")) + replace = parse_replace_arg(get_arg(req, "replace", "true")) + assert self.parentnode and self.name if req.getHeader("content-range"): raise WebError("Content-Range in PUT not yet supported", @@ -212,7 +213,8 @@ class FileNodeHandler(RenderMixin, rend.Page, ReplaceMeMixin): def render_PUT(self, ctx): req = IRequest(ctx) t = get_arg(req, "t", "").strip() - replace = boolean_of_arg(get_arg(req, "replace", "true")) + replace = parse_replace_arg(get_arg(req, "replace", "true")) + if not t: if self.node.is_mutable(): return self.replace_my_contents(req)