Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@
from testgres.operations.local_ops import LocalOperations
from testgres.operations.os_ops import OsOperations

import typing

def cached_initdb(data_dir, logfile=None, params=None, os_ops: OsOperations = None, bin_path=None, cached=True):

def cached_initdb(
data_dir,
logfile=None,
params=None,
os_ops: typing.Optional[OsOperations] = None,
bin_path=None,
cached=True,
):
"""
Perform initdb or use cached node files.
"""
Expand Down
2 changes: 2 additions & 0 deletions src/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ def _collect_special_files(self) -> typing.List[typing.Tuple[str, bytes]]:
continue

file_lines = self._os_ops.readlines(f, num_lines, binary=True, encoding=None)
assert type(file_lines) is bytes
lines = b''.join(file_lines)

# fill list
Expand Down Expand Up @@ -1010,6 +1011,7 @@ def normalize_line(line_str):
# We collect a list of rules that already exist in the file (in the form of word lists)
existing_normalized = []
for s in hba_conf_file:
assert type(s) is str
s_clean = s.strip()
if s_clean and not s_clean.startswith("#"):
existing_normalized.append(normalize_line(s_clean))
Expand Down
Loading