From: Vallari Agrawal Date: Thu, 14 May 2026 11:36:00 +0000 (+0530) Subject: mgr/dashboard: show warning message in nvmeof cli X-Git-Tag: v21.0.1~74^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F68996%2Fhead;p=ceph.git 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 --- 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)