mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
Check config file *before* checking command line parameters
Validity of command line parameters may depened on settings in the configuration file.
This commit is contained in:
@@ -847,6 +847,18 @@ main(int argc, char **argv)
|
|||||||
item_list_append(&cli_errors, too_many_args.data);
|
item_list_append(&cli_errors, too_many_args.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The configuration file is not required for some actions (e.g. 'standby clone'),
|
||||||
|
* however if available we'll parse it anyway for options like 'log_level',
|
||||||
|
* 'use_replication_slots' etc.
|
||||||
|
*/
|
||||||
|
load_config(runtime_options.config_file,
|
||||||
|
runtime_options.verbose,
|
||||||
|
runtime_options.terse,
|
||||||
|
&config_file_options,
|
||||||
|
argv[0]);
|
||||||
|
|
||||||
check_cli_parameters(action);
|
check_cli_parameters(action);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -885,16 +897,6 @@ main(int argc, char **argv)
|
|||||||
runtime_options.output_mode = OM_OPTFORMAT;
|
runtime_options.output_mode = OM_OPTFORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* The configuration file is not required for some actions (e.g. 'standby clone'),
|
|
||||||
* however if available we'll parse it anyway for options like 'log_level',
|
|
||||||
* 'use_replication_slots' etc.
|
|
||||||
*/
|
|
||||||
load_config(runtime_options.config_file,
|
|
||||||
runtime_options.verbose,
|
|
||||||
runtime_options.terse,
|
|
||||||
&config_file_options,
|
|
||||||
argv[0]);
|
|
||||||
|
|
||||||
|
|
||||||
/* check for conflicts between runtime options and configuration file */
|
/* check for conflicts between runtime options and configuration file */
|
||||||
@@ -2398,7 +2400,7 @@ get_standby_clone_mode(void)
|
|||||||
{
|
{
|
||||||
standy_clone_mode mode;
|
standy_clone_mode mode;
|
||||||
|
|
||||||
if (strcmp(config_file_options.barman_host, "") != 0 && ! runtime_options.without_barman)
|
if (*config_file_options.barman_host != '\0' && runtime_options.without_barman == false)
|
||||||
mode = barman;
|
mode = barman;
|
||||||
else
|
else
|
||||||
mode = pg_basebackup;
|
mode = pg_basebackup;
|
||||||
|
|||||||
Reference in New Issue
Block a user