correctly encode boolean values in openvz configuration

This commit is contained in:
Dietmar Maurer 2011-10-10 09:08:54 +02:00
parent f1a49f8b2b
commit 1ead9563a0

View File

@ -794,7 +794,12 @@ sub create_config_line {
my $text;
if (defined($data->{value})) {
$text .= uc($key) . "=\"$data->{value}\"\n";
if ($confdesc->{$key}->{type} eq 'boolean') {
my $txt = $data->{value} ? 'yes' : 'no';
$text .= uc($key) . "=\"$txt\"\n";
} else {
$text .= uc($key) . "=\"$data->{value}\"\n";
}
} elsif (defined($data->{bar})) {
my $tmp = format_res_bar_lim($key, $data);
$text .= uc($key) . "=\"$tmp\"\n";