From 4eeb9af12d8161ed8c8cb0e21d0da0f6be685d29 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 18 Oct 2019 10:42:32 +0200 Subject: [PATCH] reuse guest-common destroy_config Signed-off-by: Thomas Lamprecht --- src/PVE/API2/LXC.pm | 2 +- src/PVE/LXC.pm | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index 28c9047..6f47cad 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -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"; } diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 475d9be..3921229 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -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 ]; -- 2.39.5