From 1ead9563a0b7c2967b45928143ee0d0a9cb6ecdf Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 10 Oct 2011 09:08:54 +0200 Subject: [PATCH] correctly encode boolean values in openvz configuration --- PVE/OpenVZ.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PVE/OpenVZ.pm b/PVE/OpenVZ.pm index 1b67da0a..1ddfc6ef 100644 --- a/PVE/OpenVZ.pm +++ b/PVE/OpenVZ.pm @@ -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";