]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orch: disallow unimplemented format types
authorMichael Fritch <mfritch@suse.com>
Wed, 29 Jul 2020 20:14:27 +0000 (14:14 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 4 Aug 2020 14:21:44 +0000 (16:21 +0200)
unimplemented format types can cause the mgr to hang:
$ ceph orch ls --format xml

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit b7eaefa2ee1b415c60744802c75cd34adc093ccc)

src/pybind/mgr/orchestrator/module.py

index 6211a209147e01e12587d28e902fe31cf706024f..6324fc867034bbdcb0f8eec389d3c8d3d5d8a45d 100644 (file)
@@ -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):