[pve-devel] [PATCH manager v2] keep locale for vncshell and spiceshell
Dominik Csapak
d.csapak at proxmox.com
Tue Feb 28 12:22:56 CET 2017
use the new keeplocale parameter from run_command and do not delete the
LANG and LANGUAGE variable for the vncshell
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
PVE/API2/Nodes.pm | 4 ++--
PVE/API2Tools.pm | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 0542e0c..ad72e8c 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -702,12 +702,12 @@ __PACKAGE__->register_method ({
eval {
foreach my $k (keys %ENV) {
next if $k eq 'PVE_VNC_TICKET';
- next if $k eq 'PATH' || $k eq 'TERM' || $k eq 'USER' || $k eq 'HOME';
+ next if $k eq 'PATH' || $k eq 'TERM' || $k eq 'USER' || $k eq 'HOME' || $k eq 'LANG' || $k eq 'LANGUAGE';
delete $ENV{$k};
}
$ENV{PWD} = '/';
- PVE::Tools::run_command($cmd, errmsg => "vncterm failed");
+ PVE::Tools::run_command($cmd, errmsg => "vncterm failed", keeplocale => 1);
};
if (my $err = $@) {
syslog ('err', $err);
diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index 3e6eb96..2494775 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -178,9 +178,7 @@ sub run_spiceterm {
$ENV{PWD} = '/';
$ENV{SPICE_TICKET} = $ticket;
- # run_command sets LC_ALL, so we use system() instead
- system(@$cmd) == 0 ||
- die "spiceterm failed\n";
+ PVE::Tools::run_command($cmd, errmsg => 'spiceterm failed\n', keeplocale => 1);
};
if (my $err = $@) {
syslog ('err', $err);
--
2.1.4
More information about the pve-devel
mailing list