From 1b5d6259ab5df9b27cd8f7db7d066da85298938b Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Thu, 14 May 2026 17:06:00 +0530 Subject: [PATCH] mgr/dashboard: show warning message in nvmeof cli If return status=0 and there is error_message, then its a warning message from gateway, add it to output string for plain text output. It is already there for JSON output. Fixes: https://tracker.ceph.com/issues/76595 Signed-off-by: Vallari Agrawal --- src/pybind/mgr/dashboard/services/nvmeof_cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pybind/mgr/dashboard/services/nvmeof_cli.py b/src/pybind/mgr/dashboard/services/nvmeof_cli.py index 105bb421aec6..a56e5cde968c 100644 --- a/src/pybind/mgr/dashboard/services/nvmeof_cli.py +++ b/src/pybind/mgr/dashboard/services/nvmeof_cli.py @@ -488,6 +488,9 @@ class NvmeofCLICommand(DBCLICommand): self.prefix, exc_info=True) out = message if message else self._output_formatter.format_output(ret, self._model) + wrn_msg = ret.get('error_message', '') + if wrn_msg: + out += f"\nWarning: {wrn_msg}" elif out_format == 'json': out = json.dumps(ret, indent=4) -- 2.47.3