From 61ee860a53e0728e0f1c8c12b3721007475854c1 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Wed, 29 Jul 2020 14:14:27 -0600 Subject: [PATCH] mgr/orch: disallow unimplemented format types unimplemented format types can cause the mgr to hang: $ ceph orch ls --format xml Signed-off-by: Michael Fritch (cherry picked from commit b7eaefa2ee1b415c60744802c75cd34adc093ccc) --- src/pybind/mgr/orchestrator/module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 6211a209147e0..6324fc867034b 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -67,6 +67,8 @@ def to_format(what, format: str, many: bool, cls): if many: return yaml.dump_all(to_yaml(copy), default_flow_style=False) return yaml.dump(to_yaml(copy), default_flow_style=False) + else: + raise OrchestratorError(f'unsupported format type: {format}') def generate_preview_tables(data): -- 2.39.5