fixed pyyaml list indent (pyyaml/issue #234)

This commit is contained in:
Klaus Zerwes 2022-09-08 15:15:24 +02:00
parent 89f80443cb
commit e66a7a8a63

View File

@ -35,6 +35,9 @@ def isexcluded(path, _exclude_paths):
fnmatch.fnmatch(ppath, ep) fnmatch.fnmatch(ppath, ep)
for ep in _exclude_paths for ep in _exclude_paths
) )
class Dumper(yaml.Dumper):
def increase_indent(self, flow=False, *args, **kwargs):
return super().increase_indent(flow=flow, indentless=False)
basepath = os.path.dirname(os.path.realpath(__file__)) basepath = os.path.dirname(os.path.realpath(__file__))
@ -173,6 +176,7 @@ if not fqcnmapfile or args.updatefqcnmapfile:
fqcnmapfile.write( fqcnmapfile.write(
yaml.dump( yaml.dump(
fqcndict, fqcndict,
Dumper=Dumper,
sort_keys=True, sort_keys=True,
indent=2, indent=2,
width=70, width=70,