public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] pct exec: add friendly warning in case container not running
@ 2021-06-14 13:07 Oguz Bektas
  2021-06-16 18:25 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Oguz Bektas @ 2021-06-14 13:07 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
---
 src/PVE/CLI/pct.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 6b63915..ae5254c 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -189,6 +189,8 @@ __PACKAGE__->register_method ({
 	if (!@{$param->{'extra-args'}}) {
 	    die "missing command";
 	}
+	die "Error: container '$param->{vmid}' not running!\n" if !PVE::LXC::check_running($param->{vmid});
+
 	exec('lxc-attach', '-n', $param->{vmid}, '--', @{$param->{'extra-args'}});
     }});
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH container] pct exec: add friendly warning in case container not running
  2021-06-14 13:07 [pve-devel] [PATCH container] pct exec: add friendly warning in case container not running Oguz Bektas
@ 2021-06-16 18:25 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-06-16 18:25 UTC (permalink / raw)
  To: Proxmox VE development discussion, Oguz Bektas

On 14.06.21 15:07, Oguz Bektas wrote:
> Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
> ---
>  src/PVE/CLI/pct.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-16 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14 13:07 [pve-devel] [PATCH container] pct exec: add friendly warning in case container not running Oguz Bektas
2021-06-16 18:25 ` [pve-devel] applied: " Thomas Lamprecht

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