[pve-devel] [PATCH manager 1/7] NodeConfig/get_acme_conf: make domains always a hash

Dominik Csapak d.csapak at proxmox.com
Thu May 7 10:27:07 CEST 2020


on all call sites, we assume $cfg->{domains} is a hash, but if we do not
have any domains configured, that fails with
'Can't use an undefined value as a HASH reference at ...'

so always make domains a hash to avoid this

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/NodeConfig.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/NodeConfig.pm b/PVE/NodeConfig.pm
index 2de9015e..af726b15 100644
--- a/PVE/NodeConfig.pm
+++ b/PVE/NodeConfig.pm
@@ -251,6 +251,7 @@ sub get_acme_conf {
 	    die $err;
 	}
 	my $standalone_domains = delete($res->{domains}) // '';
+	$res->{domains} = {};
 	for my $domain (split(";", $standalone_domains)) {
 	    $res->{domains}->{$domain}->{plugin} = 'standalone';
 	    $res->{domains}->{$domain}->{_configkey} = 'acme';
-- 
2.20.1





More information about the pve-devel mailing list