MCPcopy Create free account
hub / github.com/ceph/ceph / mon_command

Method mon_command

src/pybind/mgr/mgr_module.py:1835–1855  ·  view source on GitHub ↗

Helper for modules that do simple, synchronous mon command execution. See send_command for general case. :return: status int, out std, err str

(self, cmd_dict: dict, inbuf: Optional[str] = None)

Source from the content-addressed store, hash-verified

1833 return r
1834
1835 def mon_command(self, cmd_dict: dict, inbuf: Optional[str] = None) -> Tuple[int, str, str]:
1836 """
1837 Helper for modules that do simple, synchronous mon command
1838 execution.
1839
1840 See send_command for general case.
1841
1842 :return: status int, out std, err str
1843 """
1844
1845 t1 = time.time()
1846 result = CommandResult()
1847 self.send_command(result, "mon", "", json.dumps(cmd_dict), "", inbuf)
1848 r = result.wait()
1849 t2 = time.time()
1850
1851 self.log.debug("mon_command: '{0}' -> {1} in {2:.3f}s".format(
1852 cmd_dict['prefix'], r[0], t2 - t1
1853 ))
1854
1855 return r
1856
1857 def osd_command(self, cmd_dict: dict, inbuf: Optional[str] = None) -> Tuple[int, str, str]:
1858 """

Callers 1

check_mon_commandMethod · 0.95

Calls 5

send_commandMethod · 0.95
waitMethod · 0.95
CommandResultClass · 0.85
debugMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected