From: Adam King Date: Wed, 3 Feb 2021 13:14:07 +0000 (-0500) Subject: mgr/orchestrator: useful message when no service type in "ceph orch apply" X-Git-Tag: v16.2.0~178^2~70 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e1ee2a5373a3adc97c939011d962db553913cf57;p=ceph.git mgr/orchestrator: useful message when no service type in "ceph orch apply" Right now it just gives a traceback. A message telling users they have not provided a proper service type would be more useful Signed-off-by: Adam King (cherry picked from commit b68675b516292ed3a2fb7a9377723fe9049b54ea) --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 1ed7124068e..54122d4029a 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1100,7 +1100,8 @@ Usage: specs.append(spec) else: placementspec = PlacementSpec.from_string(placement) - assert service_type + if not service_type: + raise OrchestratorValidationError(usage) specs = [ServiceSpec(service_type.value, placement=placementspec, unmanaged=unmanaged, preview_only=dry_run)]