When dumping generated modulemd files, line breaks are being doubled up as in the following example:
description: 'The GNU versions of commonly used grep utilities. Grep searches through textual input for lines which contain a match to a specified pattern and then prints the matching lines. GNU''s grep utilities include grep, egrep and fgrep. GNU grep is needed by many scripts, so it shall be installed on every system.'
Printing the description from Python before it gets added to the ModuleMetadata instance shows that it only has the expected number of line breaks in the actual value.
@ignatenkobrain pointed out that this is technically a dupe of https://pagure.io/modulemd/issue/40
We were considering writing our own serialiser for fedmod rpm2module anyway, because we want to emphasise human readability, which will mean using things like literal-style text fields (rather than folded-style) so they're easier to follow.
fedmod rpm2module
So I'd be OK with closing this one as well if dump() is intended solely for future machine consumption, not human readability.
Just a question about your example: did you really intend to include newlines in your description?
I'm not sure if you can force a particular dump style with PyYAML; it's very likely. However, this implementation will soon be replaced with a C-based libmodulemd, so I'd like to limit the scope of changes in this codebase.
I agree human readability is a goal worth of pursuing and something that wasn't really considered initially. The idea was that humans write or generate the input using whatever means they prefer and modulemd is then only used by automated tooling in the pipeline to read and extend the metadata. But I see how it could be useful at the very beginning, too.
modulemd
Anyway, I'm going to close this.
Metadata Update from @psabata: - Issue close_status updated to: Duplicate - Issue status updated to: Closed (was: Open)