From 034f8a3c1012b640ff59de43658ccb335aee4f26 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Fri, 24 Jul 2009 10:28:25 +0530 Subject: [PATCH 1/2] [FIX]:Bug:403652 bzr revid: nch@tinyerp.com-20090724045825-nln03qk0ecx1fmg9 --- bin/service/web_services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/service/web_services.py b/bin/service/web_services.py index 683415c112d..4989dc84591 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -532,7 +532,7 @@ GNU Public Licence. except Exception,e: rev_id = 'Exception: %s\n' % (str(e)) - os_lang = '.'.join(locale.getdefaultlocale()) + os_lang = '.'.join( [x for x in locale.getdefaultlocale() if x] ) environment = '\nEnvironment Information : \n' \ 'PlatForm : %s\n' \ 'Operating System : %s\n' \ From cff642e6f7b4f068a621d238b52461987428d48c Mon Sep 17 00:00:00 2001 From: sme <> Date: Thu, 30 Jul 2009 13:06:45 +0530 Subject: [PATCH 2/2] [IMP]:Environment info bzr revid: nch@tinyerp.com-20090730073645-63ob3em1vt10ggg1 --- bin/service/web_services.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/bin/service/web_services.py b/bin/service/web_services.py index 4989dc84591..d71f56c88a7 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -530,21 +530,30 @@ GNU Public Licence. try: rev_id = os.popen('bzr revision-info').read() except Exception,e: - rev_id = 'Exception: %s\n' % (str(e)) + rev_id = 'Exception: %s\n' % (tools.ustr(e)) os_lang = '.'.join( [x for x in locale.getdefaultlocale() if x] ) + if not os_lang: + os_lang = 'NOT SET' environment = '\nEnvironment Information : \n' \ - 'PlatForm : %s\n' \ - 'Operating System : %s\n' \ - 'Operating System Release : %s\n' \ - 'Operating System Version : %s\n' \ - 'Operating System Architecture : %s\n' \ - 'Operating System Locale : %s\n'\ - 'Python Version : %s\n'\ - 'OpenERP-Server Version : %s\n'\ - 'Last revision No. & ID : %s'\ - %(platform.platform(),os.name, platform.release(),platform.version(), - platform.architecture()[0],os_lang,platform.python_version(),release.version,rev_id) + 'System : %s\n' \ + 'OS Name : %s\n' \ + %(platform.platform(), platform.os.name) + if os.name == 'posix': + if platform.system() == 'Linux': + lsbinfo = os.popen('lsb_release -a').read() + environment += '%s'%(lsbinfo) + else: + environment += 'Your System is not lsb compliant\n' + environment += 'Operating System Release : %s\n' \ + 'Operating System Version : %s\n' \ + 'Operating System Architecture : %s\n' \ + 'Operating System Locale : %s\n'\ + 'Python Version : %s\n'\ + 'OpenERP-Server Version : %s\n'\ + 'Last revision No. & ID : %s'\ + %(platform.release(), platform.version(), platform.architecture()[0], + os_lang, platform.python_version(),release.version,rev_id) return environment common()