From 3ba77925d928f345e7c0120cf11be5c3475af436 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 30 May 2012 00:17:55 -0700 Subject: [PATCH] node.py: stop stripping whitespace in write_private_config() It's nice to add newlines to the saved file, so 'cat' is easy to use. We still strip on the input side, in get_or_create_private_config(). --- src/allmydata/node.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index aedaf842..486650e1 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -225,11 +225,10 @@ class Node(service.MultiService): def write_private_config(self, name, value): """Write the (string) contents of a private config file (which is a config file that resides within the subdirectory named 'private'), and - return it. Any leading or trailing whitespace will be stripped from - the data. + return it. """ privname = os.path.join(self.basedir, "private", name) - open(privname, "w").write(value.strip()) + open(privname, "w").write(value) def get_or_create_private_config(self, name, default=_None): """Try to get the (string) contents of a private config file (which -- 2.45.2