Oh yes, sorry, seem better with your code.
(I'm a lot busy today, It's first day of sales in France, so lot of activity on ecommerce websites) ----- Mail original ----- De: "dietmar" <diet...@proxmox.com> À: "pve-devel" <pve-devel@pve.proxmox.com>, "aderumier" <aderum...@odiso.com> Envoyé: Mercredi 7 Janvier 2015 08:35:00 Objet: Re: [pve-devel] [PATCH 2/7] add optionnal current param to config api 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