parse config: allow config keys with minus sign

In preparation for the upcoming 'fleecing-images' key. To avoid mixing
of options with - and options with _, which is not very user-friendly,
it would be nice to add aliases for existing options with _. And
long-term, backup restore handlers could switch to the modern keys
with -.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2024-11-11 14:54:32 +01:00 committed by Thomas Lamprecht
parent 800ceed2c1
commit f6a390ed08

View File

@ -2383,7 +2383,7 @@ sub parse_vm_config {
} else { } else {
$handle_error->("vm $vmid - property 'delete' is only allowed in [PENDING]\n"); $handle_error->("vm $vmid - property 'delete' is only allowed in [PENDING]\n");
} }
} elsif ($line =~ m/^([a-z][a-z_]*\d*):\s*(.+?)\s*$/) { } elsif ($line =~ m/^([a-z][a-z_\-]*\d*):\s*(.+?)\s*$/) {
my $key = $1; my $key = $1;
my $value = $2; my $value = $2;
if ($section eq 'cloudinit') { if ($section eq 'cloudinit') {