]> git.proxmox.com Git - pve-firewall.git/commitdiff
make group digest stable
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 3 Jun 2016 13:14:23 +0000 (15:14 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jun 2016 13:56:01 +0000 (15:56 +0200)
if we had mulitple security groups and wanted to
edit one, we did not have a stable digest,
because perl hashes are not sorted

this patch sorts the keys before hashing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/API2/Firewall/Groups.pm

index e8f211603b687fc9705cb6acdb4ac77f7848bf9c..99ea41877cc6196bb504e5945f13bbaff045b41a 100644 (file)
@@ -16,7 +16,7 @@ my $get_security_group_list = sub {
     my ($cluster_conf) = @_;
 
     my $res = [];
-    foreach my $group (keys %{$cluster_conf->{groups}}) {
+    foreach my $group (sort keys %{$cluster_conf->{groups}}) {
        my $data = { 
            group => $group,
        };