From: Joshua Schmid Date: Tue, 12 May 2020 08:24:37 +0000 (+0200) Subject: mgr/test_orchestrator: placementspec->host matching adaption X-Git-Tag: v15.2.4~43^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8886f2b18e74942e9fee44bbcf1e45ac3a5a7d36;p=ceph.git mgr/test_orchestrator: placementspec->host matching adaption Signed-off-by: Joshua Schmid (cherry picked from commit 646ff0f749a2c7bd7ffb1356bb6cec674f7c2c57) --- diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 04942c4d173..bf807437708 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -261,7 +261,7 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): # type: (List[orchestrator.HostSpec]) -> None drive_group.validate() if drive_group.placement.host_pattern: - if not drive_group.placement.pattern_matches_hosts([h.hostname for h in all_hosts]): + if not drive_group.placement.filter_matching_hosts(self.get_hosts): raise orchestrator.OrchestratorValidationError('failed to match') return self.get_hosts().then(run).then( on_complete=orchestrator.ProgressReference( @@ -273,11 +273,12 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): def apply_drivegroups(self, specs): # type: (List[DriveGroupSpec]) -> TestCompletion drive_group = specs[0] + def run(all_hosts): # type: (List[orchestrator.HostSpec]) -> None drive_group.validate() if drive_group.placement.host_pattern: - if not drive_group.placement.pattern_matches_hosts([h.hostname for h in all_hosts]): + if not drive_group.placement.filter_matching_hosts(self.get_hosts): raise orchestrator.OrchestratorValidationError('failed to match') return self.get_hosts().then(run).then( on_complete=orchestrator.ProgressReference(