From: Sage Weil Date: Tue, 18 Feb 2020 22:28:22 +0000 (-0600) Subject: mgr/cephadm: fix race between check_hosts and host rm X-Git-Tag: v15.1.1~362^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b28bb4a730145f8964631b75389d2d4638cb0d33;p=ceph.git mgr/cephadm: fix race between check_hosts and host rm Fixes: https://tracker.ceph.com/issues/44188 Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index f812fa7c2cb0..cb478fec81c2 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -779,7 +779,10 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): def _check_hosts(self): self.log.debug('_check_hosts') bad_hosts = [] - for host, v in self.inventory.items(): + hosts = self.inventory.keys() + for host in hosts: + if host not in self.inventory: + continue self.log.debug(' checking %s' % host) try: out, err, code = self._run_cephadm(