From 4cc6034165eba747b90c96851bdd9ec2c53f0c20 Mon Sep 17 00:00:00 2001 From: Pavlo Golub Date: Fri, 15 May 2020 16:22:15 +0200 Subject: [PATCH] Fix features/steps/standby_cluster.py under Windows (#1535) Resolves #1534 --- features/steps/standby_cluster.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/steps/standby_cluster.py b/features/steps/standby_cluster.py index 063d9f82..c04fd6f3 100644 --- a/features/steps/standby_cluster.py +++ b/features/steps/standby_cluster.py @@ -10,7 +10,8 @@ SELECT * FROM pg_catalog.pg_stat_replication WHERE application_name = '{0}' """ -callback = sys.executable + " features/callback2.py " +executable = sys.executable if os.name != 'nt' else sys.executable.replace('\\', '/') +callback = executable + " features/callback2.py " @step('I start {name:w} with callback configured') @@ -18,7 +19,7 @@ def start_patroni_with_callbacks(context, name): return context.pctl.start(name, custom_config={ "postgresql": { "callbacks": { - "on_role_change": sys.executable + " features/callback.py" + "on_role_change": executable + " features/callback.py" } } }) @@ -31,7 +32,7 @@ def start_patroni(context, name, cluster_name): "postgresql": { "callbacks": {c: callback + name for c in ('on_start', 'on_stop', 'on_restart', 'on_role_change')}, "backup_restore": { - "command": (sys.executable + " features/backup_restore.py --sourcedir=" + + "command": (executable + " features/backup_restore.py --sourcedir=" + os.path.join(context.pctl.patroni_path, 'data', 'basebackup'))} } })