From 516dfb55e1d1e542cafe72c09798f658db950fd2 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 17 Sep 2015 17:45:59 +0200 Subject: [PATCH] updateSchema: code cleanup - avoid assigning same value multiple times --- src/PVE/SectionConfig.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 5fc479e..d4d2ed5 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -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');