From 8060b526e1fecc66a6766de3f9e4b008e69af1e3 Mon Sep 17 00:00:00 2001 From: David Pravec Date: Thu, 16 Dec 2010 12:35:46 +0100 Subject: Make nova work even when user has LANG or LC_ALL configured Some commands are having different results when used in another language environment. For example ifconfig output parsing fails in my language. Also unittest using cat failed, as it didnt expect czech language in the error message. This small patch makes it work. Also adding myself to 'Authors' file. --- nova/cloudpipe/bootscript.sh | 1 + nova/tests/process_unittest.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/cloudpipe/bootscript.sh b/nova/cloudpipe/bootscript.sh index 30d9ad102..551b40f2f 100755 --- a/nova/cloudpipe/bootscript.sh +++ b/nova/cloudpipe/bootscript.sh @@ -19,6 +19,7 @@ # This gets zipped and run on the cloudpipe-managed OpenVPN server +export LC_ALL=C export SUPERVISOR="http://10.255.255.1:8773/cloudpipe" export VPN_IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{print $1}'` export BROADCAST=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f3 | awk '{print $1}'` diff --git a/nova/tests/process_unittest.py b/nova/tests/process_unittest.py index 67245af03..516b2452f 100644 --- a/nova/tests/process_unittest.py +++ b/nova/tests/process_unittest.py @@ -49,7 +49,7 @@ class ProcessTestCase(test.TrialTestCase): def test_execute_stderr(self): pool = process.ProcessPool(2) - d = pool.simple_execute('cat BAD_FILE', check_exit_code=False) + d = pool.simple_execute('LC_ALL=C cat BAD_FILE', check_exit_code=False) def _check(rv): self.assertEqual(rv[0], '') -- cgit