diff options
author | Pere Diaz Bou <pere-altea@hotmail.com> | 2023-04-06 16:24:03 +0200 |
---|---|---|
committer | Pere Diaz Bou <pere-altea@hotmail.com> | 2023-04-26 10:00:25 +0200 |
commit | 62d762f6965c5b8585d223c06cb23071a856cfcb (patch) | |
tree | 7e36435d54f4548bb457f39d34b62c0965acb6bd /src/pybind/mgr/dashboard/services | |
parent | Merge pull request #50918 from rhcs-dashboard/delete-ceph-authx (diff) | |
download | ceph-62d762f6965c5b8585d223c06cb23071a856cfcb.tar.xz ceph-62d762f6965c5b8585d223c06cb23071a856cfcb.zip |
mgr/dashboard: import/export authx users
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
Fixes: https://tracker.ceph.com/issues/59486
Diffstat (limited to 'src/pybind/mgr/dashboard/services')
-rw-r--r-- | src/pybind/mgr/dashboard/services/ceph_service.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pybind/mgr/dashboard/services/ceph_service.py b/src/pybind/mgr/dashboard/services/ceph_service.py index 730556e1d2b..f0e21c59898 100644 --- a/src/pybind/mgr/dashboard/services/ceph_service.py +++ b/src/pybind/mgr/dashboard/services/ceph_service.py @@ -302,13 +302,14 @@ class CephService(object): return mgr.get("pg_summary")['by_pool'][pool['pool'].__str__()] @staticmethod - def send_command(srv_type, prefix, srv_spec='', **kwargs): - # type: (str, str, Optional[str], Any) -> Any + def send_command(srv_type, prefix, srv_spec='', to_json=True, inbuf='', **kwargs): + # type: (str, str, Optional[str], bool, str, Any) -> Any """ :type prefix: str :param srv_type: mon | :param kwargs: will be added to argdict :param srv_spec: typically empty. or something like "<fs_id>:0" + :param to_json: if true return as json format :raises PermissionError: See rados.make_ex :raises ObjectNotFound: See rados.make_ex @@ -323,11 +324,12 @@ class CephService(object): """ argdict = { "prefix": prefix, - "format": "json", } + if to_json: + argdict["format"] = "json" argdict.update({k: v for k, v in kwargs.items() if v is not None}) result = CommandResult("") - mgr.send_command(result, srv_type, srv_spec, json.dumps(argdict), "") + mgr.send_command(result, srv_type, srv_spec, json.dumps(argdict), "", inbuf=inbuf) r, outb, outs = result.wait() if r != 0: logger.error("send_command '%s' failed. (r=%s, outs=\"%s\", kwargs=%s)", prefix, r, |