]> git.proxmox.com Git - pve-container.git/commitdiff
config: parse: also allow empty values
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 11 Mar 2021 10:26:49 +0000 (11:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 15 Mar 2021 13:04:53 +0000 (14:04 +0100)
because they are valid for '-list' formats and it makes the behavior match with
what we do for VM configs. The new pattern is the same that is used for VM
configs. Because it is a non-greedy pattern, trailing whitespaces will not be
included in the value anymore. This /should/ cause no problems and the '\s*$'
at the end suggests that that is how it was intended in the first place.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/PVE/LXC/Config.pm

index 5d223b2bdd9fb40ddb369004ee328af511f1213b..de7e9249bac347faa5b9b48aaed32bd25ddcf4cd 100644 (file)
@@ -933,7 +933,7 @@ sub parse_pct_config {
            } else {
                warn "vm $vmid - property 'delete' is only allowed in [pve:pending]\n";
            }
-       } elsif ($line =~ m/^([a-z][a-z_]*\d*):\s*(\S.*)\s*$/) {
+       } elsif ($line =~ m/^([a-z][a-z_]*\d*):\s*(.+?)\s*$/) {
            my $key = $1;
            my $value = $2;
            eval { $value = PVE::LXC::Config->check_type($key, $value); };