]> git-server-git.apps.pok.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)
committerJoshua Schmid <jschmid@suse.de>
Thu, 28 May 2020 08:10:41 +0000 (10:10 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/pybind/mgr/test_orchestrator/module.py

index 32fef723244537979d3c49b8f8ba2c801436988a..7b464290ac4ab48c97527fc2f82e6b1f790f7e66 100644 (file)
@@ -259,7 +259,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(
@@ -271,11 +271,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(