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

Method check_mon_command

src/pybind/mgr/mgr_module.py:1824–1833  ·  view source on GitHub ↗

Wrapper around :func:`~mgr_module.MgrModule.mon_command`, but raises, if ``retval != 0``.

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

Source from the content-addressed store, hash-verified

1822 return self._ceph_get_daemon_status(svc_type, svc_id)
1823
1824 def check_mon_command(self, cmd_dict: dict, inbuf: Optional[str] = None) -> HandleCommandResult:
1825 """
1826 Wrapper around :func:`~mgr_module.MgrModule.mon_command`, but raises,
1827 if ``retval != 0``.
1828 """
1829
1830 r = HandleCommandResult(*self.mon_command(cmd_dict, inbuf))
1831 if r.retval:
1832 raise MonCommandFailed(f'{cmd_dict["prefix"]} failed: {r.stderr} retval: {r.retval}')
1833 return r
1834
1835 def mon_command(self, cmd_dict: dict, inbuf: Optional[str] = None) -> Tuple[int, str, str]:
1836 """

Callers 15

rename_poolMethod · 0.95
create_poolMethod · 0.95
appify_poolMethod · 0.95
migrate_4_5Method · 0.80
get_cluster_healthFunction · 0.80
_set_noautoscaleMethod · 0.80
_unset_noautoscaleMethod · 0.80
_set_container_imagesMethod · 0.80

Calls 3

mon_commandMethod · 0.95
HandleCommandResultClass · 0.85
MonCommandFailedClass · 0.85

Tested by 7

test_mds_config_purgeMethod · 0.64
test_upgrade_runMethod · 0.64
test_upgrade_runFunction · 0.64
test_rgw_updateMethod · 0.64