]> git.proxmox.com Git - pve-common.git/commitdiff
updateSchema: code cleanup - avoid assigning same value multiple times
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Sep 2015 15:45:59 +0000 (17:45 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Sep 2015 15:45:59 +0000 (17:45 +0200)
src/PVE/SectionConfig.pm

index 5fc479eb7b446d90ec228fa9e493cd7d1ccbfdee..d4d2ed57e43437db4a73b231862f25452d07d2fc 100644 (file)
@@ -75,13 +75,17 @@ sub updateSchema {
            $props->{$p} = $propertyList->{$p};
            next;
        }
+
+       my $modifyable = 0;
+
        foreach my $t (keys %$plugins) {
-           my $opts = $pdata->{options}->{$t};
+           my $opts = $pdata->{options}->{$t} || {};
            next if !defined($opts->{$p});
-           if (!$opts->{$p}->{fixed}) {
-               $props->{$p} = $propertyList->{$p};
-           }
+           $modifyable = 1 if !$opts->{$p}->{fixed};
        }
+       next if !$modifyable;
+
+       $props->{$p} = $propertyList->{$p};
     }
 
     $props->{digest} = get_standard_option('pve-config-digest');