From: Sebastian Wagner Date: Tue, 21 Apr 2020 11:02:57 +0000 (+0200) Subject: mgr/cephadm: _apply_service: fix _create_iscsi invocation X-Git-Tag: v15.2.4~73^2~88 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d83091ed8644a9b8ed5b29a2b485bcbfe8578f91;p=ceph.git mgr/cephadm: _apply_service: fix _create_iscsi invocation Fixes: https://tracker.ceph.com/issues/45249 Signed-off-by: Sebastian Wagner (cherry picked from commit 53da12e7eb5e58eaa7bb205f565cec6e8caa4f27) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 81d4cb3bd3a..3f81c0b457b 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2068,7 +2068,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): try: tree = json.loads(out) except json.decoder.JSONDecodeError: - self.log.error(f"Could not decode json -> {out}") + self.log.exception(f"Could not decode json -> {out}") return osd_host_map nodes = tree.get('nodes', {}) @@ -2479,10 +2479,10 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): daemon_type, daemon_id, host)) if daemon_type == 'mon': create_func(daemon_id, host, network) # type: ignore - elif daemon_type == 'nfs': + elif daemon_type in ['nfs', 'iscsi']: create_func(daemon_id, host, spec) # type: ignore else: - create_func(daemon_id, host) # type: ignore + create_func(daemon_id, host) # type: ignore # add to daemon list so next name(s) will also be unique sd = orchestrator.DaemonDescription( @@ -2514,7 +2514,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): if self._apply_service(spec): r = True except Exception as e: - self.log.warning('Failed to apply %s spec %s: %s' % ( + self.log.exception('Failed to apply %s spec %s: %s' % ( spec.service_name(), spec, e)) return r @@ -2625,9 +2625,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): daemon_type, daemon_id, host)) if daemon_type == 'mon': args.append((daemon_id, host, network)) # type: ignore - elif daemon_type == 'nfs': - args.append((daemon_id, host, spec)) # type: ignore - elif daemon_type == 'iscsi': + elif daemon_type in ['nfs', 'iscsi']: args.append((daemon_id, host, spec)) # type: ignore else: args.append((daemon_id, host)) # type: ignore