diff options
Diffstat (limited to 'kvmd/yamlconf')
-rw-r--r-- | kvmd/yamlconf/dumper.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/yamlconf/dumper.py b/kvmd/yamlconf/dumper.py index b0a561e5..ffc5fc38 100644 --- a/kvmd/yamlconf/dumper.py +++ b/kvmd/yamlconf/dumper.py @@ -21,13 +21,14 @@ import textwrap -import operator from typing import Generator from typing import Any import yaml +from .. import tools + from . import Section @@ -37,7 +38,7 @@ def make_config_dump(config: Section, indent: int=4) -> str: def _inner_make_dump(config: Section, indent: int, _level: int=0) -> Generator[str, None, None]: - for (key, value) in sorted(config.items(), key=operator.itemgetter(0)): + for (key, value) in tools.sorted_kvs(config): if isinstance(value, Section): prefix = " " * indent * _level yield f"{prefix}{key}:" |