This seems to not be compatible with pyyaml 6.0
```
File "/lib/python3.12/site-packages/ceph/deployment/service_spec.py", line 1350, in __repr__
y = yaml.dump(cast(dict, self), default_flow_style=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib64/python3.12/site-packages/yaml/__init__.py", line 253, in dump
return dump_all([data], stream, Dumper=Dumper, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib64/python3.12/site-packages/yaml/__init__.py", line 241, in dump_all
dumper.represent(data)
File "/lib64/python3.12/site-packages/yaml/representer.py", line 28, in represent
self.serialize(node)
File "/lib64/python3.12/site-packages/yaml/serializer.py", line 54, in serialize
self.serialize_node(node, None, None)
File "/lib64/python3.12/site-packages/yaml/serializer.py", line 104, in serialize_node
self.emit(MappingStartEvent(alias, node.tag, implicit,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Prepared.__init__() got an unexpected keyword argument 'flow_style'
```
and didn't seem to cause any issues with making our specs look
readable in the logs or being able to round-trip specs
when using `ceph orch ls --export` (minus the known bug
around doing so with multi-line certs)
Resolves: rhbz#
2402684
Signed-off-by: Adam King <adking@redhat.com>
to_yaml = to_yaml_n if many else to_yaml_1
if many:
- return yaml.dump_all(to_yaml(copy), default_flow_style=False)
- return yaml.dump(to_yaml(copy), default_flow_style=False)
+ return yaml.dump_all(to_yaml(copy))
+ return yaml.dump(to_yaml(copy))
elif format == Format.xml or format == Format.xml_pretty:
raise OrchestratorError(f"format '{format.name}' is not implemented.")
else:
if format != Format.plain:
return HandleCommandResult(stdout=to_format(bindings_ls, format, many=False, cls=None))
else:
- result_str = yaml.dump(bindings_ls, default_flow_style=False, sort_keys=False)
+ result_str = yaml.dump(bindings_ls, sort_keys=False)
return HandleCommandResult(stdout=result_str)
@_cli_read_command('orch certmgr cert check')
)
def __repr__(self) -> str:
- y = yaml.dump(cast(dict, self), default_flow_style=False)
+ y = yaml.dump(cast(dict, self))
return f"{self.__class__.__name__}.from_json(yaml.safe_load('''{y}'''))"
def __eq__(self, other: Any) -> bool: