mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
MINOR: cli: remove error message with 'set anon on|off'
Removed the error message in 'set anon on|off', it's more user friendly: users use 'set anon on' even if the mode is already activated, and the same for 'set anon off'. That allows users to write the command line in the anonymized mode they want without errors. No backport needed, except if anonymization mechanism is backported.
This commit is contained in:
parent
2a2e46ff20
commit
3f4ae6194e
10
src/cli.c
10
src/cli.c
@ -1882,9 +1882,7 @@ static int cli_parse_set_anon(char **args, char *payload, struct appctx *appctx,
|
|||||||
long long key;
|
long long key;
|
||||||
|
|
||||||
if (strcmp(args[2], "on") == 0) {
|
if (strcmp(args[2], "on") == 0) {
|
||||||
if (appctx->cli_anon_key != 0)
|
|
||||||
return cli_err(appctx, "Mode already enabled\n");
|
|
||||||
else {
|
|
||||||
if (*args[3]) {
|
if (*args[3]) {
|
||||||
key = atoll(args[3]);
|
key = atoll(args[3]);
|
||||||
if (key < 1 || key > UINT_MAX)
|
if (key < 1 || key > UINT_MAX)
|
||||||
@ -1899,11 +1897,9 @@ static int cli_parse_set_anon(char **args, char *payload, struct appctx *appctx,
|
|||||||
appctx->cli_anon_key = ha_random32();
|
appctx->cli_anon_key = ha_random32();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (strcmp(args[2], "off") == 0) {
|
else if (strcmp(args[2], "off") == 0) {
|
||||||
if (appctx->cli_anon_key == 0)
|
|
||||||
return cli_err(appctx, "Mode already disabled\n");
|
if (*args[3]) {
|
||||||
else if (*args[3]) {
|
|
||||||
return cli_err(appctx, "Key can't be added while disabling anonymized mode\n");
|
return cli_err(appctx, "Key can't be added while disabling anonymized mode\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user