public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Matthias Heiserer <m.heiserer@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Subject: Re: [pve-devel] [PATCH container] fix #3927: Stopped containers now return 0, like VMs do
Date: Thu, 17 Mar 2022 11:45:01 +0100	[thread overview]
Message-ID: <d5935c4b-d591-e01c-1cfd-b8298066ba18@proxmox.com> (raw)
In-Reply-To: <20220317101458.2501712-1-d.tschlatscher@proxmox.com>

On 17.03.2022 11:15, Daniel Tschlatscher wrote:
> Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
> ---
>   src/PVE/API2/LXC/Status.pm | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/API2/LXC/Status.pm b/src/PVE/API2/LXC/Status.pm
> index f7e3128..f414f7a 100644
> --- a/src/PVE/API2/LXC/Status.pm
> +++ b/src/PVE/API2/LXC/Status.pm
> @@ -237,8 +237,12 @@ __PACKAGE__->register_method({
>   	my $skiplock = extract_param($param, 'skiplock');
>   	raise_param_exc({ skiplock => "Only root may use this option." })
>   	    if $skiplock && $authuser ne 'root@pam';
> -
> -	die "CT $vmid not running\n" if !PVE::LXC::check_running($vmid);
> +	Trailing whitespace
> +	# Containers that are already stopped should exit with code 0, like VMs do
> +	if (!PVE::LXC::check_running($vmid)) {
> +		print "CT $vmid not running\n";
> +		exit 0;
> +	}
Wrong identation, should be tab + 4 spaces
>   
>   	if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
>   





      reply	other threads:[~2022-03-17 10:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 10:15 Daniel Tschlatscher
2022-03-17 10:45 ` Matthias Heiserer [this message]

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=d5935c4b-d591-e01c-1cfd-b8298066ba18@proxmox.com \
    --to=m.heiserer@proxmox.com \
    --cc=d.tschlatscher@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal