From: Sage Weil Date: Sat, 25 Jan 2020 16:38:50 +0000 (-0600) Subject: mgr/cephadm: tolerate unknown service state X-Git-Tag: v15.1.1~568^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=caeb5bff81140d1574dae2c39f7badb814d89152;p=ceph-ci.git mgr/cephadm: tolerate unknown service state Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 1a0d373a1d7..4784ec2fbe9 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1218,13 +1218,17 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): sd.container_image_name = d.get('container_image_name') sd.container_image_id = d.get('container_image_id') sd.version = d.get('version') - sd.status_desc = d['state'] - sd.status = { - 'running': 1, - 'stopped': 0, - 'error': -1, - 'unknown': -1, - }[d['state']] + if 'state' in d: + sd.status_desc = d['state'] + sd.status = { + 'running': 1, + 'stopped': 0, + 'error': -1, + 'unknown': -1, + }[d['state']] + else: + sd.status_desc = 'unknown' + sd.status = None result.append(sd) return result