5
0
mirror of git://git.proxmox.com/git/pve-cluster.git synced 2025-03-12 20:58:25 +03:00

datacenter.cfg: fix fall back for undefined config

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reported-by: Oguz Bektas <o.bektas@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-11-15 14:27:12 +01:00
parent 87f7608e66
commit b5e2b244dd

View File

@ -231,6 +231,8 @@ sub get_datacenter_schema { return $datacenter_schema };
sub parse_datacenter_config {
my ($filename, $raw) = @_;
$raw = '' if !defined($raw);
# description may be comment or key-value pair (or both)
my $comment = '';
my @lines = split(/\n/, $raw);
@ -241,7 +243,7 @@ sub parse_datacenter_config {
}
# parse_config ignores lines with # => use $raw
my $res = PVE::JSONSchema::parse_config($datacenter_schema, $filename, $raw // '');
my $res = PVE::JSONSchema::parse_config($datacenter_schema, $filename, $raw);
$res->{description} = $comment;