[pve-devel] [PATCH] Create firewall dir on ct restore, if it does not exists.

Wolfgang Link w.link at proxmox.com
Thu Jan 28 09:00:41 CET 2016


---
 PVE/QemuServer.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index d10e1e5..88e288c 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5476,7 +5476,11 @@ sub restore_vma_archive {
 	    "unable to read qemu-server.conf - $!\n";
 
 	my $fwcfgfn = "$tmpdir/qemu-server.fw";
-	PVE::Tools::file_copy($fwcfgfn, "/etc/pve/firewall/$vmid.fw")
+	my $pve_firewall_dir = '/etc/pve/firewall/';
+
+	mkdir $pve_firewall_dir if (!-f '$pve_firewall_dir');
+
+	PVE::Tools::file_copy($fwcfgfn, "${pve_firewall_dir}/$vmid.fw")
 	    if -f $fwcfgfn;
 
 	while (defined(my $line = <$fh>)) {
-- 
2.1.4





More information about the pve-devel mailing list