From 3fa2bef6f4ba57d4e259e3986dab1d88ad524d46 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 23 Nov 2017 22:48:34 +0900 Subject: [PATCH] repmgr: fix configuration file sanity check The check was being carried out regardless of whether --copy-external-config-files was specified, which means cloning will fail if no SSH connection is available. Addresses GitHub #342 --- repmgr-action-standby.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 1085a2a7..bc9f7b96 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -359,7 +359,7 @@ do_standby_clone(void) * If copying of external configuration files requested, and any are * detected, perform sanity checks */ - if (PQstatus(source_conn) == CONNECTION_OK) + if (PQstatus(source_conn) == CONNECTION_OK && runtime_options.copy_external_config_files == true) { PGconn *superuser_conn = NULL; PGconn *privileged_conn = NULL; @@ -549,7 +549,7 @@ do_standby_clone(void) * This won't run in Barman mode as "config_files" is only populated in * "initialise_direct_clone()", which isn't called in Barman mode. */ - if (runtime_options.copy_external_config_files && config_files.entries) + if (runtime_options.copy_external_config_files == true && config_files.entries > 0) { copy_configuration_files(); }