From: Dietmar Maurer Date: Sun, 19 Feb 2017 13:45:08 +0000 (+0100) Subject: SectionConfig:write_config: sort options by key name X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=df89e5eb156ec9931d19d73c8a5ac3deaf70414f;ds=sidebyside SectionConfig:write_config: sort options by key name Else we can get different config digest... --- 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);