From: Dhairya Parmar Date: Mon, 28 Aug 2023 10:29:17 +0000 (+0530) Subject: mgr/nfs: include pseudo in JSON output when nfs export apply -i fails X-Git-Tag: v19.3.0~135^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11114764817b4ee77646cd4e459410626b729301;p=ceph.git mgr/nfs: include pseudo in JSON output when nfs export apply -i fails [ { "msg": "Failed to apply export: export FSAL user_id must be 'nfs.my-nfs.1'", "state": "error" }, { "msg": "Failed to apply export: export FSAL user_id must be 'nfs.my-nfs.2'", "state": "error" } ] it is a bit of hassle to know which export's update/creation failed as the dict contains no info about the export(like pseudo path), therefore with something like below, it is much better to figure out which export block needs correction [ { "pseudo": "cephfs1", "msg": "Failed to apply export: export FSAL user_id must be 'nfs.my-nfs.1'", "state": "error" }, { "pseudo": "cephfs2", "msg": "Failed to apply export: export FSAL user_id must be 'nfs.my-nfs.2'", "state": "error" } ] Fixes: https://tracker.ceph.com/issues/62626 Signed-off-by: Dhairya Parmar --- diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index aaa93c34f6c1..2d07cd6eab60 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -583,7 +583,8 @@ class ExportMgr: except Exception as ex: msg = f'Failed to apply export: {ex}' log.exception(msg) - return {"state": "error", "msg": msg, "exception": ex} + return {"state": "error", "msg": msg, "exception": ex, + "pseudo": export['pseudo']} def _update_user_id( self,