[pve-devel] [PATCH guest-common 5/5] cleanup: iterate over values in find_local_replication_job

Fabian Ebner f.ebner at proxmox.com
Wed Oct 14 13:36:28 CEST 2020


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/ReplicationConfig.pm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/PVE/ReplicationConfig.pm b/PVE/ReplicationConfig.pm
index a220594..343ad2a 100644
--- a/PVE/ReplicationConfig.pm
+++ b/PVE/ReplicationConfig.pm
@@ -218,9 +218,7 @@ sub check_for_existing_jobs {
 sub find_local_replication_job {
     my ($cfg, $vmid, $target) = @_;
 
-    foreach my $id (keys %{$cfg->{ids}}) {
-	my $data = $cfg->{ids}->{$id};
-
+    foreach my $data (values %{$cfg->{ids}}) {
 	return $data if $data->{type} eq 'local' &&
 	    $data->{guest} == $vmid && $data->{target} eq $target;
     }
-- 
2.20.1






More information about the pve-devel mailing list