[pve-devel] [PATCH v2 pve-container] error when failing to extract rather than warn
Wolfgang Bumiller
w.bumiller at proxmox.com
Fri Nov 20 13:39:24 CET 2015
---
Patch 2 of the version 1 series I sent earlier can be applied.
src/PVE/LXC/Create.pm | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index 58db2d2..014eaa0 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -212,14 +212,10 @@ sub create_rootfs {
my $rootdir = PVE::LXC::mount_all($vmid, $storage_cfg, $conf);
restore_and_configure($vmid, $archive, $rootdir, $conf, $password, $restore);
};
- if (my $err = $@) {
- warn $err;
- PVE::LXC::umount_all($vmid, $storage_cfg, $conf, 1);
- } else {
- PVE::LXC::umount_all($vmid, $storage_cfg, $conf, 0);
- }
-
+ my $err = $@;
+ PVE::LXC::umount_all($vmid, $storage_cfg, $conf, $err ? 1 : 0);
PVE::Storage::deactivate_volumes($storage_cfg, PVE::LXC::get_vm_volumes($conf));
+ die $err if $err;
}
1;
--
2.1.4
More information about the pve-devel
mailing list