]> git.proxmox.com Git - pve-container.git/commitdiff
reuse guest-common destroy_config
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 08:42:32 +0000 (10:42 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 08:44:30 +0000 (10:44 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm
src/PVE/LXC.pm

index 28c90473d2b7693820f9f93b63134793d1372ebb..6f47cadb66808fa69d05510c9fddb85f39b17666 100644 (file)
@@ -449,7 +449,7 @@ __PACKAGE__->register_method({
            };
            if (my $err = $@) {
                PVE::LXC::destroy_disks($storage_cfg, $vollist);
-               eval { PVE::LXC::destroy_config($vmid) };
+               eval { PVE::LXC::Config->destroy_config($vmid) };
                warn $@ if $@;
                die "$emsg $err";
            }
index 475d9be08eafb9bbd1bc8680e02ae6091cd45521..392122977c42f35b23e0058b5b302975e9bc785a 100644 (file)
@@ -52,13 +52,6 @@ sub config_list {
     return $res;
 }
 
-sub destroy_config {
-    my ($vmid) = @_;
-
-    my $config_fn = PVE::LXC::Config->config_file($vmid, $nodename);
-    unlink $config_fn or die "failed to remove config file: $!\n";
-}
-
 # container status helpers
 
 sub list_active_containers {
@@ -755,7 +748,7 @@ sub destroy_lxc_container {
     if (defined $replacement_conf) {
        PVE::LXC::Config->write_config($vmid, $replacement_conf);
     } else {
-       destroy_config($vmid);
+       PVE::LXC::Config->destroy_config($vmid);
     }
 
     #my $cmd = ['lxc-destroy', '-n', $vmid ];