From 7cb8860420c7825353c2647e8dff703990a3b4b6 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Mon, 29 Dec 2025 20:32:54 +0300 Subject: [PATCH 1/2] PostgresNode::kill uses os_ops.kill --- src/node.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node.py b/src/node.py index 3c5b2b7..50576c9 100644 --- a/src/node.py +++ b/src/node.py @@ -1206,11 +1206,12 @@ def kill(self, someone=None): If None, the main PostgreSQL node process will be killed. Defaults to None. """ if self.is_started: + assert isinstance(self._os_ops, OsOperations) sig = signal.SIGKILL if os.name != 'nt' else signal.SIGBREAK if someone is None: - os.kill(self.pid, sig) + self._os_ops.kill(self.pid, sig) else: - os.kill(self.auxiliary_pids[someone][0], sig) + self._os_ops.kill(self.auxiliary_pids[someone][0], sig) self.is_started = False def restart(self, params=[]): From 3bf1069fb9c6d9b03be760eccc58ee71471b1b39 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Mon, 29 Dec 2025 20:33:16 +0300 Subject: [PATCH 2/2] PostgresNode::upgrade_from uses os_ops.path_exists --- src/node.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node.py b/src/node.py index 50576c9..c39f0ea 100644 --- a/src/node.py +++ b/src/node.py @@ -2120,10 +2120,11 @@ def upgrade_from(self, old_node, options=None, expect_error=False): Args: old_node: An instance of PostgresNode representing the old node. """ - if not os.path.exists(old_node.data_dir): + assert isinstance(self._os_ops, OsOperations) + if not self._os_ops.path_exists(old_node.data_dir): raise Exception("Old node must be initialized") - if not os.path.exists(self.data_dir): + if not self._os_ops.path_exists(self.data_dir): self.init() if not options: @@ -2131,7 +2132,7 @@ def upgrade_from(self, old_node, options=None, expect_error=False): pg_upgrade_binary = self._get_bin_path("pg_upgrade") - if not os.path.exists(pg_upgrade_binary): + if not self._os_ops.path_exists(pg_upgrade_binary): raise Exception("pg_upgrade does not exist in the new node's binary path") upgrade_command = [