[pve-devel] [PATCH container] restore: fix fw.conf restore for PBS

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Dec 7 09:18:49 CET 2020


the 'files' command returns a list of hashes, and the filename is
'fw.conf.blob' not 'fw.conf'.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
Tested with container with and without firewall config.

 src/PVE/LXC/Create.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index 39902a2..5c64566 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -280,7 +280,7 @@ sub restore_configuration_from_proxmox_backup {
     my $cmd = "files";
 
     my $list = PVE::Storage::PBSPlugin::run_client_cmd($scfg, $storeid, "files", [$name]);
-    my $has_fw_conf = grep { $_ eq 'fw.conf' } @$list;
+    my $has_fw_conf = grep { $_->{filename} eq 'fw.conf.blob' } @$list;
 
     if ($has_fw_conf) {
 	my $pve_firewall_dir = '/etc/pve/firewall';
-- 
2.20.1






More information about the pve-devel mailing list