]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
scripts/create_node.py: allow nickname to be Unicode. Also ensure webport is validly...
authordavid-sarah <david-sarah@jacaranda.org>
Mon, 2 Aug 2010 00:02:12 +0000 (17:02 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Mon, 2 Aug 2010 00:02:12 +0000 (17:02 -0700)
src/allmydata/scripts/create_node.py

index d98b421d5682807fa6ec277469bfabb348788a39..8841d35041646759216b2d3e9b6248a59a5bf13a 100644 (file)
@@ -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")