[pve-devel] [Patch V2 container 2/2] Mark CT as a template after rename volumes.

Wolfgang Link w.link at proxmox.com
Wed May 30 12:12:52 CEST 2018


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.11.0





More information about the pve-devel mailing list