From 71d8d06f820ea1447718bf76909a56bff5d990f7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 28 Feb 2020 10:17:50 -0600 Subject: [PATCH] mgr/orch: PlacementSpec: do not combine all_hosts with anything else Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator/_interface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 9b9fb4df254..7adee48d7fe 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1228,6 +1228,8 @@ class PlacementSpec(object): """ def __init__(self, label=None, hosts=None, count=None, all_hosts=False): # type: (Optional[str], Optional[List], Optional[int], bool) -> None + if all_hosts and (count or hosts or label): + raise OrchestratorValidationError('cannot combine all:true and count|hosts|label') self.label = label self.hosts = [] # type: List[HostPlacementSpec] if hosts: -- 2.39.5