]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Show an error when invalid format 45023/head
authorRedouane Kachach <rkachach@redhat.com>
Mon, 14 Feb 2022 14:17:31 +0000 (15:17 +0100)
committerRedouane Kachach <rkachach@redhat.com>
Tue, 15 Feb 2022 10:58:14 +0000 (11:58 +0100)
Fixes: https://tracker.ceph.com/issues/54198
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/pybind/mgr/orchestrator/module.py

index 2d73361fc6b223f5d7be8bb6671e67266964d279..d8ceaf4066c212601f01cd31e3c1709f18060fb3 100644 (file)
@@ -44,6 +44,8 @@ class Format(enum.Enum):
     json = 'json'
     json_pretty = 'json-pretty'
     yaml = 'yaml'
+    xml_pretty = 'xml-pretty'
+    xml = 'xml'
 
 
 class ServiceType(enum.Enum):
@@ -115,6 +117,8 @@ def to_format(what: Any, format: Format, many: bool, cls: Any) -> Any:
         if many:
             return yaml.dump_all(to_yaml(copy), default_flow_style=False)
         return yaml.dump(to_yaml(copy), default_flow_style=False)
+    elif format == Format.xml or format == Format.xml_pretty:
+        raise OrchestratorError(f"format '{format.name}' is not implemented.")
     else:
         raise OrchestratorError(f'unsupported format type: {format}')