apple / foundationdb

FoundationDB - the open source, distributed, transactional key-value store

Home Page:https://apple.github.io/foundationdb/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make_public.py fails if the cluster file contains comments

weaversam8 opened this issue · comments

The FoundationDB docs for the cluster file format specify that a cluster file can contain comments.

A cluster file may contain comments, marked by the # character. All characters on a line after the first occurrence of a # will be ignored.

Indeed, the coordinators FDB CLI command adds comments when writing an updated cluster file:

atomicReplace(filename,
"# DO NOT EDIT!\n# This file is auto-generated, it is not to be edited by hand\n" +
cs.toString().append("\n"));

However, when running make_public.py, the code to check for a valid cluster file fails to accommodate comments:

f = open(clusterFile, "r")
clusterStr = None
for line in f:
line = line.strip()
if len(line) > 0:
if clusterStr is not None:
invalidClusterFile(clusterFile)
return
clusterStr = line