[pve-devel] [PATCH manager 1/3] keep locale for vncshell and spiceshell

Dominik Csapak d.csapak at proxmox.com
Tue Feb 28 12:06:39 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  | 3 +--
 2 files changed, 3 insertions(+), 4 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..dfe368b 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -179,8 +179,7 @@ sub run_spiceterm {
 	    $ENV{SPICE_TICKET} = $ticket;
 
 	    # run_command sets LC_ALL, so we use system() instead
-	    system(@$cmd) == 0 || 
-		die "spiceterm failed\n";
+	    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