From b68675b516292ed3a2fb7a9377723fe9049b54ea Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 3 Feb 2021 08:14:07 -0500 Subject: [PATCH] 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 --- src/pybind/mgr/orchestrator/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 534da49bde458..c6c566cbfffec 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1099,7 +1099,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)] -- 2.39.5