1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmdevices: check yes option for adding duplicate

This commit is contained in:
David Teigland 2021-08-18 16:26:11 -05:00
parent 96b777167c
commit b0bda7c25b
3 changed files with 5 additions and 1 deletions

View File

@ -30,6 +30,7 @@ struct config_info {
int verbose;
int silent;
int test;
int yes;
int syslog;
int activation;
int suffix;

View File

@ -1138,7 +1138,8 @@ id_done:
du_pvid->dev ? dev_name(du_pvid->dev) : "none", du_pvid->idname,
pvid);
if (yes_no_prompt("Add device with duplicate PV to devices file?") == 'n') {
if (!cmd->current_settings.yes &&
yes_no_prompt("Add device with duplicate PV to devices file?") == 'n') {
log_print("Device not added.");
free((void *)check_idname);
return 1;

View File

@ -2446,6 +2446,8 @@ static int _get_current_settings(struct cmd_context *cmd)
if (arg_is_set(cmd, test_ARG))
cmd->current_settings.test = arg_is_set(cmd, test_ARG);
cmd->current_settings.yes = arg_count(cmd, yes_ARG);
if (arg_is_set(cmd, driverloaded_ARG)) {
cmd->current_settings.activation =
arg_int_value(cmd, driverloaded_ARG,