adds feature parity between qm/pct 'listsnapshot' w.r.t. showing
snapshot tree ordered by date.

Signed-off-by: Oguz Bektas <o.bek...@proxmox.com>
---
 src/PVE/CLI/pct.pm | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 35ad72f..705a015 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -861,16 +861,7 @@ our $cmddef = {
 
     delsnapshot => [ "PVE::API2::LXC::Snapshot", 'delsnapshot', ['vmid', 
'snapname'], { node => $nodename } , $upid_exit ],
 
-    listsnapshot => [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node => 
$nodename },
-                     sub {
-                         my $res = shift;
-                         foreach my $e (@$res) {
-                             my $headline = $e->{description} || 
'no-description';
-                             $headline =~ s/\n.*//sg;
-                             my $parent = $e->{parent} // 'no-parent';
-                             printf("%-20s %-20s %s\n", $e->{name}, $parent, 
$headline);
-                         }
-                     }],
+    listsnapshot => [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node => 
$nodename }, \&PVE::GuestHelpers::print_snapshot_tree ],
 
     rollback => [ "PVE::API2::LXC::Snapshot", 'rollback', ['vmid', 
'snapname'], { node => $nodename } , $upid_exit ],
 
-- 
2.20.1

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

Reply via email to