From: Fabian Ebner Date: Thu, 11 Mar 2021 10:26:50 +0000 (+0100) Subject: vmstatus: make lock property optional again X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=7790ecf67598ab6bf98787730f3d450e1a8e089c vmstatus: make lock property optional again Commit d02262048cbbe91ca8b12f98e3dc7bbab28e4c64 made the property de-facto non-optional. Partially revert this and instead adapt the printing, making the behavior match the API description again. The conditional assignment is already there further down the vmstatus function. Signed-off-by: Fabian Ebner --- diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm index 856d5a5..69faf8d 100755 --- a/src/PVE/CLI/pct.pm +++ b/src/PVE/CLI/pct.pm @@ -810,7 +810,8 @@ our $cmddef = { my $format = "%-10s %-10s %-12s %-20s\n"; printf($format, 'VMID', 'Status', 'Lock', 'Name'); foreach my $d (sort {$a->{vmid} <=> $b->{vmid} } @$res) { - printf($format, $d->{vmid}, $d->{status}, $d->{lock}, $d->{name}); + my $lock = $d->{lock} || ''; + printf($format, $d->{vmid}, $d->{status}, $lock, $d->{name}); } }], config => [ "PVE::API2::LXC::Config", 'vm_config', ['vmid'], diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index bae236b..6395d12 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -203,7 +203,6 @@ sub vmstatus { $d->{cpus} = $conf->{cores} || $conf->{cpulimit}; $d->{cpus} = $cpucount if !$d->{cpus}; - $d->{lock} = $conf->{lock} || ''; $d->{tags} = $conf->{tags} if defined($conf->{tags}); if ($d->{pid}) {