From: Michael Fritch Date: Wed, 29 Jul 2020 20:14:27 +0000 (-0600) Subject: mgr/orch: disallow unimplemented format types X-Git-Tag: wip-pdonnell-testing-20200918.022351~474^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b7eaefa2ee1b415c60744802c75cd34adc093ccc;p=ceph-ci.git 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 --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index f1000fe18d1..3c8d7d83c6b 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -66,6 +66,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):