all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC/PATCH v2 container 5/5] vmstatus: make lock property optional again
Date: Thu, 11 Mar 2021 11:26:50 +0100	[thread overview]
Message-ID: <20210311102650.6730-6-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210311102650.6730-1-f.ebner@proxmox.com>

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>
---

New in v2.

Alternatively, the property description should be updated, but this patch makes
it in line with what we do for VMs and is preferable IMHO.

 src/PVE/CLI/pct.pm | 3 ++-
 src/PVE/LXC.pm     | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

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 082cab8..7a52196 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}) {
-- 
2.20.1





  parent reply	other threads:[~2021-03-11 10:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 10:26 [pve-devel] [PATCH-SERIES v2] small improvements for parsing and printing Fabian Ebner
2021-03-11 10:26 ` [pve-devel] [PATCH v2 manager 1/5] ui: avoid errors when 'template' property is not present in guest status Fabian Ebner
2021-03-15 13:00   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-11 10:26 ` [pve-devel] [PATCH v2 qemu-server 2/5] vmstatus: make template property optional Fabian Ebner
2021-03-15 13:00   ` Thomas Lamprecht
2021-05-26  8:57     ` Fabian Ebner
2021-05-26 15:41   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-11 10:26 ` [pve-devel] [PATCH v2 container 3/5] " Fabian Ebner
2021-03-15 13:01   ` Thomas Lamprecht
2021-03-16  8:04     ` Fabian Ebner
2021-05-26 15:41   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-11 10:26 ` [pve-devel] [PATCH v2 container 4/5] config: parse: also allow empty values Fabian Ebner
2021-03-15 13:24   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-11 10:26 ` Fabian Ebner [this message]
2021-03-15 13:42   ` [pve-devel] applied: [RFC/PATCH v2 container 5/5] vmstatus: make lock property optional again Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210311102650.6730-6-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal