X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FSectionConfig.pm;h=a6301e262598d0ee7886144ec104cb51301e5b24;hp=6f85b228b81ec82c77d64fbbbc8f0197e5274e01;hb=a056df6bda40bf387b7cd0541f76a2c15e06b849;hpb=ebd2b0aca54022f80abfbea0167d1ac2143f4771 diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 6f85b22..a6301e2 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -184,7 +184,7 @@ sub init { } $propertyList->{type}->{type} = 'string'; - $propertyList->{type}->{enum} = [keys %$plugins]; + $propertyList->{type}->{enum} = [sort keys %$plugins]; } sub lookup { @@ -203,7 +203,7 @@ sub lookup_types { my $pdata = $class->private(); - return [ keys %{$pdata->{plugins}} ]; + return [ sort keys %{$pdata->{plugins}} ]; } sub decode_value { @@ -400,7 +400,8 @@ my $format_config_line = sub { if ($key =~ m/[\n\r]/) || ($value =~ m/[\n\r]/); if ($ct eq 'boolean') { - return $value ? "\t$key\n" : ''; + return "\t$key " . ($value ? 1 : 0) . "\n" + if defined($value); } else { return "\t$key $value\n" if "$value" ne ''; }