from mgr_module import HandleCommandResult
from ceph.deployment.service_spec import IscsiServiceSpec
-from orchestrator import DaemonDescription, DaemonDescriptionStatus, OrchestratorError
+from orchestrator import DaemonDescription, DaemonDescriptionStatus
from .cephadmservice import CephadmDaemonDeploySpec, CephService
from .. import utils
"""
logger.debug(f'Post remove daemon {self.TYPE}.{daemon.daemon_id}')
- ret, out, err = self.mgr.check_mon_command({
- 'prefix': 'mgr module ls',
- 'format': 'json',
- })
- try:
- j = json.loads(out)
- except ValueError:
- msg = 'Failed to parse mgr module ls: Cannot decode JSON'
- logger.exception('%s: \'%s\'' % (msg, out))
- raise OrchestratorError('failed to parse mgr module ls')
-
- if 'dashboard' in j['enabled_modules']:
+ if 'dashboard' in self.mgr.get('mgr_map')['modules']:
# remove config for dashboard iscsi gateways
ret, out, err = self.mgr.check_mon_command({
'prefix': 'dashboard iscsi-gateway-rm',
placement=ps)
unmanaged_spec = ServiceSpec.from_json(spec.to_json())
unmanaged_spec.unmanaged = True
- cephadm_module._mon_command_mock_mgr_module_ls = lambda *args: json.dumps({
- 'enabled_modules': []})
with with_service(cephadm_module, unmanaged_spec):
c = cephadm_module.add_daemon(spec)
@mock.patch("subprocess.run", mock.MagicMock())
def test_apply_save(self, spec: ServiceSpec, meth, cephadm_module: CephadmOrchestrator):
with with_host(cephadm_module, 'test'):
- cephadm_module._mon_command_mock_mgr_module_ls = lambda *args: json.dumps({
- 'enabled_modules': []})
with with_service(cephadm_module, spec, meth, 'test'):
pass