From 52a5c112f1e99b6f8e47b3be97445562b08147c4 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Tue, 9 Nov 2021 13:59:20 +0300 Subject: [PATCH] stats: clarify error messages in cfg_no_stats_reporter_{statsd,log} Change-Id: I287130213c7de31a510f293bed0f3daddd53ce04 Related: SYS#5713 --- src/vty/stats_vty.c | 8 ++++---- tests/stats/stats_vty_test.vty | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 308bab679..c6c50efa4 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -312,8 +312,8 @@ DEFUN(cfg_no_stats_reporter_statsd, cfg_no_stats_reporter_statsd_cmd, srep = osmo_stats_reporter_find(OSMO_STATS_REPORTER_STATSD, name); if (!srep) { - vty_out(vty, "%% No statsd logging active%s", - VTY_NEWLINE); + vty_out(vty, "%% There is no such statsd reporter with name '%s'%s", + name ? name : "", VTY_NEWLINE); return CMD_WARNING; } @@ -366,8 +366,8 @@ DEFUN(cfg_no_stats_reporter_log, cfg_no_stats_reporter_log_cmd, srep = osmo_stats_reporter_find(OSMO_STATS_REPORTER_LOG, name); if (!srep) { - vty_out(vty, "%% No log reporting active%s", - VTY_NEWLINE); + vty_out(vty, "%% There is no such log reporter with name '%s'%s", + name ? name : "", VTY_NEWLINE); return CMD_WARNING; } diff --git a/tests/stats/stats_vty_test.vty b/tests/stats/stats_vty_test.vty index ddfb3a632..94cc7e8e1 100644 --- a/tests/stats/stats_vty_test.vty +++ b/tests/stats/stats_vty_test.vty @@ -203,6 +203,11 @@ stats_vty_test(config)# no stats reporter log log-zoo stats_vty_test(config)# show running-config ... !(foo|bar|zoo) +stats_vty_test(config)# no stats reporter statsd statsd-foo +% There is no such statsd reporter with name 'statsd-foo' +stats_vty_test(config)# no stats reporter log log-zoo +% There is no such log reporter with name 'log-zoo' + stats_vty_test(config)# stats interval 1337 stats_vty_test(config)# show running-config