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

index 10381db9c14a7bcf53b09129dd82cb83021b2b15..1e3170282960aa95d9a57d61012b167c826e2f71 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):
@@ -116,6 +118,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}')