]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/test_orchestrator: placementspec->host matching adaption
authorJoshua Schmid <jschmid@suse.de>
Tue, 12 May 2020 08:24:37 +0000 (10:24 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Mon, 8 Jun 2020 11:52:24 +0000 (13:52 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
(cherry picked from commit 646ff0f749a2c7bd7ffb1356bb6cec674f7c2c57)

src/pybind/mgr/test_orchestrator/module.py

index 04942c4d1733ea800058d024500e9d7a956a4129..bf807437708acd0e2e05f7ff081288c4d83de8f1 100644 (file)
@@ -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(