diff --git a/koji_containerbuild/plugins/cli_containerbuild.py b/koji_containerbuild/plugins/cli_containerbuild.py index ec2cb87c..a4ed17f6 100644 --- a/koji_containerbuild/plugins/cli_containerbuild.py +++ b/koji_containerbuild/plugins/cli_containerbuild.py @@ -42,9 +42,9 @@ def print_result(result, level=0, indent=2): for item in result: print_result(item, level+1) elif isinstance(result, dict): - for key, value in result.items(): + for key in sorted(result): print_value(key, level, indent, ':') - print_result(value, level+1) + print_result(result[key], level+1) else: print_value(result, level, indent) diff --git a/tests/test_cli_containerbuild.py b/tests/test_cli_containerbuild.py index e7d4520c..10f4c8e8 100644 --- a/tests/test_cli_containerbuild.py +++ b/tests/test_cli_containerbuild.py @@ -125,9 +125,9 @@ def _expected_output(result, offset, indent): for line in _expected_output(item, offset+indent, indent): yield line elif isinstance(result, dict): - for key, value in result.items(): + for key in sorted(result): yield '{}{}:\n'.format(offset, key) - for line in _expected_output(value, offset+indent, indent): + for line in _expected_output(result[key], offset+indent, indent): yield line else: yield '{}{}\n'.format(offset, result)