repmgr standby follow: ensure data directory provided, if required

Required when using host parameters to reactivate a stopped node;
we have no other way of knowing the data directory.
This commit is contained in:
Ian Barwick
2017-06-23 13:42:07 +09:00
parent ae67e086a4
commit a5d15c22a8
2 changed files with 18 additions and 1 deletions

View File

@@ -968,6 +968,22 @@ check_cli_parameters(const int action)
}
}
break;
case STANDBY_FOLLOW:
{
/*
* if `repmgr standby follow` executed with host params, ensure data
* directory was provided
*/
if (runtime_options.host_param_provided == true)
{
if (runtime_options.data_dir[0] == '\0')
{
item_list_append_format(&cli_errors,
_("-D/--data-dir required when providing connection parameters for \"standby follow\""));
}
}
}
case CLUSTER_EVENT:
/* no required parameters */
break;