]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: _apply_service: fix _create_iscsi invocation
authorSebastian Wagner <sebastian.wagner@suse.com>
Tue, 21 Apr 2020 11:02:57 +0000 (13:02 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 21 May 2020 21:33:18 +0000 (23:33 +0200)
Fixes: https://tracker.ceph.com/issues/45249
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 53da12e7eb5e58eaa7bb205f565cec6e8caa4f27)

src/pybind/mgr/cephadm/module.py

index 81d4cb3bd3a4f8e4d6ab1b293a0e96ecef861f4b..3f81c0b457b815faf1c317f71243594aaccfc6b8 100644 (file)
@@ -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