From: Wolfgang Link Date: Wed, 30 May 2018 10:12:52 +0000 (+0200) Subject: Mark CT as a template after rename volumes. X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=c2182c490d62f5429f4fc3cb2b7161d135d5dbd3 Mark CT as a template after rename volumes. If a rename fails, the CT should not mark as a template. --- diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index bce5fa3..c016b44 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -1168,13 +1168,13 @@ __PACKAGE__->register_method({ my $realcmd = sub { PVE::LXC::template_create($vmid, $conf); - }; - $conf->{template} = 1; + $conf->{template} = 1; - PVE::LXC::Config->write_config($vmid, $conf); - # and remove lxc config - PVE::LXC::update_lxc_config($vmid, $conf); + PVE::LXC::Config->write_config($vmid, $conf); + # and remove lxc config + PVE::LXC::update_lxc_config($vmid, $conf); + }; return $rpcenv->fork_worker('vztemplate', $vmid, $authuser, $realcmd); };