mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Don't fail if pg_hba/pg_ident contain comment lines (#2888)
yaml parser interprets such lines as null and stores it as None into the array of the parsed values, which can not be handled by write() function and crashes the whole bootstrap process. Even though it is not the proper value, it won't hurt if we just ignore it instead of failing completely.
This commit is contained in:
@@ -244,9 +244,10 @@ class ConfigWriter(object):
|
||||
self._fd.write(line)
|
||||
self._fd.write('\n')
|
||||
|
||||
def writelines(self, lines: List[str]) -> None:
|
||||
def writelines(self, lines: List[Optional[str]]) -> None:
|
||||
for line in lines:
|
||||
self.writeline(line)
|
||||
if isinstance(line, str):
|
||||
self.writeline(line)
|
||||
|
||||
@staticmethod
|
||||
def escape(value: Any) -> str: # Escape (by doubling) any single quotes or backslashes in given string
|
||||
|
||||
Reference in New Issue
Block a user