From: Sebastian Wagner Date: Sun, 7 Jun 2020 16:24:30 +0000 (+0200) Subject: mgr/orch: apply: Fix proper error when passed unknown type X-Git-Tag: v16.1.0~2088^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F35459%2Fhead;p=ceph.git mgr/orch: apply: Fix proper error when passed unknown type Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 0518941c6e0f9..ec15f2ad78643 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1000,7 +1000,9 @@ Usage: else: placmentspec = PlacementSpec.from_string(placement) - assert service_type + if not service_type: + raise OrchestratorValidationError(f'Error: Empty service_type\n{usage}') + specs = [ServiceSpec(service_type, placement=placmentspec, unmanaged=unmanaged)] completion = self.apply(specs)