]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephadm: still set keep_container_info key in CoreStatusUpdater when cinfo is None
authorAdam King <adking@redhat.com>
Tue, 8 Apr 2025 15:36:57 +0000 (11:36 -0400)
committerAdam King <adking@redhat.com>
Tue, 8 Apr 2025 15:36:57 +0000 (11:36 -0400)
commit49405967620c9dbb69a1ea4660af46c240fcd298
tree18a93b82692b3d5cc67d453e0851b1d69f343f76
parent5549c10c7f049de10a327ae30eba80376e9ad412
cephadm: still set keep_container_info key in CoreStatusUpdater when cinfo is None

When testing an unrelated thing with rm-cluster cleaning up
OSD devices, I was hitting

```
Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/sbin/cephadm/__main__.py", line 5400, in <module>
  File "/usr/sbin/cephadm/__main__.py", line 5388, in main
  File "/usr/sbin/cephadm/__main__.py", line 3996, in command_rm_cluster
  File "/usr/sbin/cephadm/__main__.py", line 4034, in _rm_cluster
  File "/usr/sbin/cephadm/__main__.py", line 428, in _infer_image
  File "/usr/sbin/cephadm/cephadmlib/container_lookup.py", line 127, in infer_local_ceph_image
  File "/usr/sbin/cephadm/cephadmlib/container_lookup.py", line 128, in <listcomp>
KeyError: '_container_info'
```

which appears to have been caused by the CoreStatusUpdater only
setting the "keep_container_info" key entry when the container
info it gets back from get_container_stats is not None. This
patch has it set that key entry even when the container info
is None, and updates infer_local_ceph_image to be able to
handle the container info at that entry being None as well.

Signed-off-by: Adam King <adking@redhat.com>
src/cephadm/cephadmlib/container_lookup.py
src/cephadm/cephadmlib/listing_updaters.py
src/cephadm/tests/test_cephadm.py
src/cephadm/tests/test_listing.py