From df89e5eb156ec9931d19d73c8a5ac3deaf70414f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 19 Feb 2017 14:45:08 +0100 Subject: [PATCH] SectionConfig:write_config: sort options by key name Else we can get different config digest... --- src/PVE/SectionConfig.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 6273afa..bfe4f8b 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -453,7 +453,8 @@ sub write_config { my $done_hash = { comment => 1, disable => 1}; - foreach my $k (keys %$opts) { + my @option_keys = sort keys %$opts; + foreach my $k (@option_keys) { next if $opts->{$k}->{optional}; $done_hash->{$k} = 1; my $v = $scfg->{$k}; @@ -463,7 +464,7 @@ sub write_config { $data .= &$format_config_line($propertyList->{$k}, $k, $v); } - foreach my $k (keys %$opts) { + foreach my $k (@option_keys) { next if defined($done_hash->{$k}); my $v = $scfg->{$k}; next if !defined($v); -- 2.39.2