mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Update handling of --replication-user
This commit is contained in:
@@ -204,6 +204,11 @@ main(int argc, char **argv)
|
||||
runtime_options.force = true;
|
||||
break;
|
||||
|
||||
/* --replication-user (master/standby register only) */
|
||||
case OPT_REPLICATION_USER:
|
||||
strncpy(runtime_options.replication_user, optarg, MAXLEN);
|
||||
break;
|
||||
|
||||
/* -W/--wait */
|
||||
case 'W':
|
||||
runtime_options.wait = true;
|
||||
@@ -350,10 +355,6 @@ main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
case OPT_REPLICATION_USER:
|
||||
strncpy(runtime_options.replication_user, optarg, MAXLEN);
|
||||
break;
|
||||
|
||||
case OPT_UPSTREAM_CONNINFO:
|
||||
strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN);
|
||||
break;
|
||||
@@ -1066,6 +1067,25 @@ check_cli_parameters(const int action)
|
||||
}
|
||||
}
|
||||
|
||||
if (runtime_options.replication_user[0])
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case MASTER_REGISTER:
|
||||
case STANDBY_REGISTER:
|
||||
break;
|
||||
case STANDBY_CLONE:
|
||||
case STANDBY_FOLLOW:
|
||||
item_list_append_format(&cli_warnings,
|
||||
_("--replication-user ignored when executing %s)"),
|
||||
action_name(action));
|
||||
default:
|
||||
item_list_append_format(&cli_warnings,
|
||||
_("--replication-user not required when executing %s"),
|
||||
action_name(action));
|
||||
}
|
||||
}
|
||||
|
||||
if (runtime_options.limit_provided)
|
||||
{
|
||||
switch (action)
|
||||
|
||||
Reference in New Issue
Block a user