On 01/02/2015 03:15 PM, Alexandre Derumier wrote:
+
+       if(!$param->{current} || (defined($param->{current}) && 
$param->{current} == 0)) {
+           foreach my $opt (keys $conf->{pending}) {
+               foreach my $opt 
(PVE::Tools::split_list($conf->{pending}->{delete})) {
+                   delete $conf->{$opt} if $conf->{$opt};
+               }
+               next if ref($conf->{pending}->{$opt}); # just to be sure
+               $conf->{$opt} = $conf->{pending}->{$opt};
+           }
+       }
+

This looks also a bit strange (loop inside loop?).I changed this to:

    if (!$param->{current}) {
        foreach my $opt (keys $conf->{pending}) {
        next if $opt eq 'delete';
        my $value = $conf->{pending}->{$opt};
        next if ref($value); # just to be sure
        $conf->{$opt} = $value;
        }
foreach my $opt (PVE::Tools::split_list($conf->{pending}->{delete})) {
        delete $conf->{$opt} if $conf->{$opt};
        }
    }


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to