From: Kefu Chai Date: Tue, 1 Sep 2020 05:07:17 +0000 (+0800) Subject: pybind/rados: construct cmd as an array of a single entry X-Git-Tag: v16.1.0~1112^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d10914d5aaa60682a56ec27692aa4dfd6d901b9;p=ceph.git pybind/rados: construct cmd as an array of a single entry otherwise what monitor receives would be something like mon_command({ " p r e f i x " : " o s d m a p " ... difficult to parse/grep by machine/human. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 7ef2d8b546a3..04acc51dbdd3 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -1381,7 +1381,7 @@ Rados object in state %s." % self.state) # timeout argument, but we keep it for backward compat with old python binding self.require_state("connected") - cmd = cstr_list(cmd, 'c') + cmd = [cstr(cmd, 'cmd')] if isinstance(target, int): # NOTE(sileht): looks weird but test_monmap_dump pass int @@ -1439,12 +1439,11 @@ Rados object in state %s." % self.state) # timeout argument, but we keep it for backward compat with old python binding self.require_state("connected") - cmd = cstr_list(cmd, 'cmd') - inbuf = cstr(inbuf, 'inbuf') + cmds = [cstr(cmd, 'cmd')] cdef: int _osdid = osdid - char **_cmd = to_bytes_array(cmd) + char **_cmd = to_bytes_array(cmds) size_t _cmdlen = len(cmd) char *_inbuf = inbuf @@ -1481,15 +1480,15 @@ Rados object in state %s." % self.state) # timeout argument, but we keep it for backward compat with old python binding self.require_state("connected") - cmd = cstr_list(cmd, 'cmd') + cmds = [cstr(cmd, 'cmd')] inbuf = cstr(inbuf, 'inbuf') target = cstr(target, 'target', opt=True) cdef: char *_target = opt_str(target) - char **_cmd = to_bytes_array(cmd) - size_t _cmdlen = len(cmd) + char **_cmd = to_bytes_array(cmds) + size_t _cmdlen = len(cmds) char *_inbuf = inbuf size_t _inbuf_len = len(inbuf)