[pve-devel] [PATCH v2 manager 1/2] pvesr: rename last_snapshots to local_snapshots

Fabian Ebner f.ebner at proxmox.com
Mon Jun 13 12:29:54 CEST 2022


while dropping the instance where the local variable was unused.
prepare() was changed a while ago to return all local snapshots.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

New in v2.

 PVE/CLI/pvesr.pm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/PVE/CLI/pvesr.pm b/PVE/CLI/pvesr.pm
index cb79e2bf..a1be88af 100644
--- a/PVE/CLI/pvesr.pm
+++ b/PVE/CLI/pvesr.pm
@@ -136,16 +136,16 @@ __PACKAGE__->register_method ({
 	    my $images = $plugin->list_images($storeid, $scfg, $vmid, undef, $cache);
 	    push @$volids, map { $_->{volid} } @$images;
 	}
-	my ($last_snapshots, $cleaned_replicated_volumes) = PVE::Replication::prepare($storecfg, $volids, $jobid, $last_sync, $parent_snapname, $logfunc);
+	my ($local_snapshots, $cleaned_replicated_volumes) = PVE::Replication::prepare($storecfg, $volids, $jobid, $last_sync, $parent_snapname, $logfunc);
 	foreach my $volid (keys %$cleaned_replicated_volumes) {
 	    if (!$wanted_volids->{$volid}) {
 		$logfunc->("$jobid: delete stale volume '$volid'");
 		PVE::Storage::vdisk_free($storecfg, $volid);
-		delete $last_snapshots->{$volid};
+		delete $local_snapshots->{$volid};
 	    }
 	}
 
-	print to_json($last_snapshots) . "\n";
+	print to_json($local_snapshots) . "\n";
 
 	return undef;
     }});
@@ -200,8 +200,7 @@ __PACKAGE__->register_method ({
 	    print STDERR "$msg\n";
 	};
 
-	my $last_snapshots = PVE::Replication::prepare(
-	    $storecfg, $volids, $jobid, $last_sync, undef, $logfunc);
+	PVE::Replication::prepare($storecfg, $volids, $jobid, $last_sync, undef, $logfunc);
 
 	return undef;
     }});
-- 
2.30.2






More information about the pve-devel mailing list