From: david-sarah Date: Mon, 2 Aug 2010 00:02:12 +0000 (-0700) Subject: scripts/create_node.py: allow nickname to be Unicode. Also ensure webport is validly... X-Git-Url: https://git.rkrishnan.org/vdrive/%22news.html/simplejson/$sch_link?a=commitdiff_plain;h=16647b49f6c49d7b60a69eed045f27d97985ffb1;p=tahoe-lafs%2Ftahoe-lafs.git scripts/create_node.py: allow nickname to be Unicode. Also ensure webport is validly encoded in config file. --- diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py index d98b421d..8841d350 100644 --- a/src/allmydata/scripts/create_node.py +++ b/src/allmydata/scripts/create_node.py @@ -70,11 +70,14 @@ def write_node_config(c, config): c.write("\n\n") c.write("[node]\n") - c.write("nickname = %s\n" % config.get("nickname", "")) #TODO: utf8 in argv? - webport = config.get("webport", "none") + nickname = argv_to_unicode(config.get("nickname") or "") + c.write("nickname = %s\n" % (nickname.encode('utf-8'),)) + + # TODO: validate webport + webport = argv_to_unicode(config.get("webport") or "none") if webport.lower() == "none": webport = "" - c.write("web.port = %s\n" % webport) + c.write("web.port = %s\n" % (webport.encode('utf-8'),)) c.write("web.static = public_html\n") c.write("#tub.port =\n") c.write("#tub.location = \n")