From b7a3cb6b74850ef71fbbeacbee63df791caba626 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Wed, 9 Dec 2015 12:53:43 +0000 Subject: bugfix: Fix failure caused by unset locale In case, that VSPERF detects missing locale settings, it will set language and encodding settings to default values specified by configuration parameter DEFAULT_LOCALE. Localized external commands with output parsed by VSPERF are executed with modified locale to ensure correct VSPERF function. Locale settings for such commands is specified by configuration parameter DEFAULT_CMD_LOCALE. Change-Id: If5c15115b778ce90046e390f10438b780f82695b JIRA: VSPERF-132 Signed-off-by: Martin Klozik Reviewed-by: Maryam Tahhan Reviewed-by: Al Morton Reviewed-by: Brian Castelli Reviewed-by: Gurpreet Singh Reviewed-by: Tv Rao --- tools/collectors/sysmetrics/pidstat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/collectors/sysmetrics/pidstat.py') diff --git a/tools/collectors/sysmetrics/pidstat.py b/tools/collectors/sysmetrics/pidstat.py index 608a0d6c..5106697e 100644 --- a/tools/collectors/sysmetrics/pidstat.py +++ b/tools/collectors/sysmetrics/pidstat.py @@ -74,7 +74,8 @@ class Pidstat(collector.ICollector): pids = systeminfo.get_pids(monitor) if pids: with open(self._log, 'w') as logfile: - cmd = ['sudo', 'pidstat', settings.getValue('PIDSTAT_OPTIONS'), + cmd = ['sudo', 'LC_ALL=' + settings.getValue('DEFAULT_CMD_LOCALE'), + 'pidstat', settings.getValue('PIDSTAT_OPTIONS'), '-p', ','.join(pids), str(settings.getValue('PIDSTAT_SAMPLE_INTERVAL'))] self._logger.debug('%s', ' '.join(cmd)) -- cgit 1.2.3-korg