mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
Use a better check for when to issue an error message
This patch changes raising the error "You need to use connection parameters to the master when issuing a STANDBY CLONE command." to only occur when no host (a global variable, that is abused for at least two purposes, but is okay in this case) is passed, rather than when no config file is passed, which is fine for standby clone (which itself is a wrapper for rsync) Signed-off-by: Daniel Farina <daniel@heroku.com>
This commit is contained in:
23
repmgr.c
23
repmgr.c
@@ -1557,19 +1557,20 @@ check_parameters_for_action(const int action)
|
||||
ok = false;
|
||||
}
|
||||
break;
|
||||
case STANDBY_CLONE:
|
||||
/*
|
||||
* To clone a master into a standby we need connection parameters
|
||||
* repmgr.conf is useless because we don't have a server running
|
||||
* in the standby
|
||||
*/
|
||||
if (config_file != NULL)
|
||||
{
|
||||
fprintf(stderr, "\nYou need to use connection parameters to the master when issuing a STANDBY CLONE command.");
|
||||
case STANDBY_CLONE:
|
||||
/*
|
||||
* To clone a master into a standby we need connection parameters
|
||||
* repmgr.conf is useless because we don't have a server running in
|
||||
* the standby; warn the user, but keep going.
|
||||
*/
|
||||
if (host == NULL)
|
||||
{
|
||||
fprintf(stderr, "\nYou need to use connection parameters to "
|
||||
"the master when issuing a STANDBY CLONE command.");
|
||||
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
|
||||
progname);
|
||||
ok = false;
|
||||
}
|
||||
ok = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user