]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Add strings to assert statements 39162/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 29 Jan 2021 10:10:38 +0000 (11:10 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 29 Jan 2021 10:10:38 +0000 (11:10 +0100)
This helps with: https://tracker.ceph.com/issues/48981

Looks like there is an assert somewhere:

```
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1269, in _handle_command
    return self.handle_command(inbuf, cmd)
   ...snip...
  File "/usr/share/ceph/mgr/orchestrator/module.py", line 550, in _list_services
    raise_if_exception(completion)
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 653, in raise_if_exception
    raise e
AssertionError
```

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py

index 1b51547c6c996333517ca6a0772b8658b64e0279..ee82f78e204124dc58b1f2d286fbbdc5a4d7eb92 100644 (file)
@@ -467,7 +467,7 @@ class HostCache():
         """Provide a list of the types of daemons on the host"""
         result = set()
         for _d, dm in self.daemons[hostname].items():
-            assert dm.daemon_type is not None
+            assert dm.daemon_type is not None, f'no daemon type for {dm!r}'
             result.add(dm.daemon_type)
         return list(result)
 
index a6ffdb4a037be383e43f5b8c03f58502757cfc60..ace2b98de4b7fa2f9327cbc1d9ed8b959b544486 100644 (file)
@@ -1469,8 +1469,8 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
         osd_count = 0
         for h, dm in self.cache.get_daemons_with_volatile_status():
             for name, dd in dm.items():
-                assert dd.hostname is not None
-                assert dd.daemon_type is not None
+                assert dd.hostname is not None, f'no hostname for {dd!r}'
+                assert dd.daemon_type is not None, f'no daemon_type for {dd!r}'
 
                 if service_type and service_type != dd.daemon_type:
                     continue