From: Alfonso Martínez Date: Wed, 22 Apr 2020 13:31:50 +0000 (+0200) Subject: mgr/test_orchestrator: fix _get_ceph_daemons() X-Git-Tag: v16.1.0~2386^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34689%2Fhead;p=ceph.git mgr/test_orchestrator: fix _get_ceph_daemons() * Improved regex to match appropriate processes' strings. * Removed unused variables. Fixes: https://tracker.ceph.com/issues/45186 Signed-off-by: Alfonso Martínez --- diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 04942c4d173..32fef723244 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -165,11 +165,10 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): types = ("mds", "osd", "mon", "rgw", "mgr") out = map(str, check_output(['ps', 'aux']).splitlines()) processes = [p for p in out if any( - [('ceph-' + t in p) for t in types])] + [('ceph-{} '.format(t) in p) for t in types])] daemons = [] for p in processes: - daemon = orchestrator.DaemonDescription() # parse daemon type m = re.search('ceph-([^ ]+)', p) if m: @@ -179,7 +178,6 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): # parse daemon ID. Possible options: `-i `, `--id=`, `--id ` patterns = [r'-i\s(\w+)', r'--id[\s=](\w+)'] - daemon_id = None for pattern in patterns: m = re.search(pattern, p) if m: