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:
Daniel Farina
2011-02-10 03:12:51 -08:00
parent da82829659
commit 4b007bf4bc

View File

@@ -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;
}