From: Jiri Denemark <jdenemar(a)redhat.com>
Both vshWarn and vshError are just wrappers around vshPrintStderr which
properly propagates the message level to the log, but fails to honor it
when printing on stderr.
https://issues.redhat.com/browse/RHEL-79460
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tools/vsh.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index 05845e2c1e..e892cbca22 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2123,7 +2123,11 @@ vshPrintStderr(vshControl *ctl,
* printing to stderr will not interleave correctly with stdout
* unless we flush between every transition between streams. */
fflush(stdout);
- fprintf(stderr, _("error: %1$s\n"), NULLSTR(str));
+
+ if (level == VSH_ERR_WARNING)
+ fprintf(stderr, _("warning: %1$s\n"), NULLSTR(str));
+ else
+ fprintf(stderr, _("error: %1$s\n"), NULLSTR(str));
fflush(stderr);
}
--
2.49.0