From 94c1b46698ea3e363015bffc95015071551c6963 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alfonso=20Mart=C3=ADnez?= Date: Wed, 22 Apr 2020 15:31:50 +0200 Subject: [PATCH] mgr/test_orchestrator: fix _get_ceph_daemons() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Improved regex to match appropriate processes' strings. * Removed unused variables. Fixes: https://tracker.ceph.com/issues/45186 Signed-off-by: Alfonso Martínez --- src/pybind/mgr/test_orchestrator/module.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 04942c4d1733..32fef7232445 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: -- 2.47.3