[pve-devel] [PATCH common] SectionConfig: always write out booleans

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Oct 11 12:01:38 CEST 2016


Because when only writing the ones which are true we're
breaking the ones which default to true (like the mkdir
option on directory storages, where we need a false value
to be written out explicitly).
---
 src/PVE/SectionConfig.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm
index 3030f60..34c7986 100644
--- a/src/PVE/SectionConfig.pm
+++ b/src/PVE/SectionConfig.pm
@@ -400,7 +400,7 @@ 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";
     } else {
 	return "\t$key $value\n" if "$value" ne '';
     }
-- 
2.1.4





More information about the pve-devel mailing list