]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/orch: disallow unimplemented format types
authorMichael Fritch <mfritch@suse.com>
Wed, 29 Jul 2020 20:14:27 +0000 (14:14 -0600)
committerMichael Fritch <mfritch@suse.com>
Wed, 29 Jul 2020 20:17:54 +0000 (14:17 -0600)
unimplemented format types can cause the mgr to hang:
$ ceph orch ls --format xml

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/orchestrator/module.py

index f1000fe18d1a631f09a8a27cce6d1065788faf44..3c8d7d83c6b26ba12efef00086d7e4b5e257f9fc 100644 (file)
@@ -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):