]> git.proxmox.com Git - pve-container.git/commitdiff
vmstatus: make lock property optional again
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 11 Mar 2021 10:26:50 +0000 (11:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 15 Mar 2021 13:40:58 +0000 (14:40 +0100)
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 <f.ebner@proxmox.com>
src/PVE/CLI/pct.pm
src/PVE/LXC.pm

index 856d5a57e23e1bdbea7948126dbe7890e0c6bfca..69faf8d01f8e063b7f8e9075434542426b056907 100755 (executable)
@@ -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'], 
index bae236b0a2a3ca2833791242f9ddb678493b3ed8..6395d12814452b35ad2a9a545839f2c432b97258 100644 (file)
@@ -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}) {