diff --git a/src/pybind/mgr/cephadm/services/iscsi.py b/src/pybind/mgr/cephadm/services/iscsi.py index a36ad3bca16..3dd367b1528 100644 --- a/src/pybind/mgr/cephadm/services/iscsi.py +++ b/src/pybind/mgr/cephadm/services/iscsi.py @@ -8,7 +8,7 @@ from ipaddress import ip_address, IPv6Address 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 @@ -150,18 +150,7 @@ class IscsiService(CephService): """ 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', diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index 2daf2ee0798..b80500b108b 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -891,8 +891,6 @@ spec: 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) @@ -1026,8 +1024,6 @@ 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