From c2182c490d62f5429f4fc3cb2b7161d135d5dbd3 Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Wed, 30 May 2018 12:12:52 +0200 Subject: [PATCH] Mark CT as a template after rename volumes. If a rename fails, the CT should not mark as a template. --- src/PVE/API2/LXC.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); }; -- 2.39.2