]> git.proxmox.com Git - pve-container.git/commitdiff
Mark CT as a template after rename volumes.
authorWolfgang Link <w.link@proxmox.com>
Wed, 30 May 2018 10:12:52 +0000 (12:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 30 May 2018 10:42:59 +0000 (12:42 +0200)
If a rename fails, the CT should not mark as a template.

src/PVE/API2/LXC.pm

index bce5fa3865dec6d72a2ec6c12d7d6e0e1c7788ac..c016b44effbc979058d138e3f42a6306b4256ada 100644 (file)
@@ -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);
        };