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)
| 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 | """ |
no test coverage detected