Commit 02b31f32 authored by Iustin Pop's avatar Iustin Pop
Browse files

ssconf: empty files should not add a newline

Currently we add a newline in the ssconf writeout process, even if the
file is empty. We chage this case so that lists of values (e.g. offline
nodes) are correct (not a list of one empty element).

Reviewed-by: imsnah
parent 99b5ef90
......@@ -185,7 +185,7 @@ class SimpleStore(object):
ssconf_lock.Exclusive(blocking=True, timeout=SSCONF_LOCK_TIMEOUT)
for name, value in values.iteritems():
if not value.endswith("\n"):
if value and not value.endswith("\n"):
value += "\n"
utils.WriteFile(self.KeyToFilename(name), data=value)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment