On 10/25/19 11:24 AM, Dominic Jäger wrote: > The destroy_vm in the eval could only die if the VM were a template. > This is not possible here. > > Signed-off-by: Dominic Jäger <d.jae...@proxmox.com> > --- > PVE/CLI/qm.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm > index a378d3d..a16033c 100755 > --- a/PVE/CLI/qm.pm > +++ b/PVE/CLI/qm.pm > @@ -650,7 +650,7 @@ __PACKAGE__->register_method ({ > }; > my $err = $@; > if ($err) { > - eval { PVE::QemuServer::destroy_vm($storecfg, $vmid, undef, 1); > }; > + PVE::QemuServer::destroy_vm($storecfg, $vmid, undef, 1); > die "import failed - $err"; > } > }); >
it still useful to have this in error paths, IMO, better safe than sorry (and overwriting the actual error, if it dies). Adding a warn "$@" if "$@"; below the eval could be more useful... _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel