[pve-devel] [PATCH manager] fix iteration over hash without keys

Dominik Csapak d.csapak at proxmox.com
Fri Nov 20 15:14:22 CET 2020


without 'keys' we iterate also over the values and use them as keys

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/ReplicationConfig.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/ReplicationConfig.pm b/PVE/API2/ReplicationConfig.pm
index 63b9cfca..8af62621 100644
--- a/PVE/API2/ReplicationConfig.pm
+++ b/PVE/API2/ReplicationConfig.pm
@@ -189,7 +189,7 @@ __PACKAGE__->register_method ({
 	    my $plugin = PVE::ReplicationConfig->lookup($data->{type});
 	    my $opts = $plugin->check_config($id, $param, 0, 1);
 
-	    foreach my $k (%$opts) {
+	    foreach my $k (keys %$opts) {
 		$data->{$k} = $opts->{$k};
 	    }
 
-- 
2.20.1






More information about the pve-devel mailing list