Fix features/steps/standby_cluster.py under Windows (#1535)

Resolves #1534
This commit is contained in:
Pavlo Golub
2020-05-15 16:22:15 +02:00
committed by GitHub
parent 30aa355eb5
commit 4cc6034165
+4 -3
View File
@@ -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'))}
}
})