diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 1ae839ba65d..edceb08f475 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -32,7 +32,7 @@ def check_ssl(): try: from OpenSSL import SSL import socket - + return hasattr(socket, 'ssl') and hasattr(SSL, "Connection") except: return False @@ -350,7 +350,18 @@ class configmanager(object): self.options['translate_modules'] = opt.translate_modules and map(lambda m: m.strip(), opt.translate_modules.split(',')) or ['all'] self.options['translate_modules'].sort() + # TODO checking the type of the parameters should be done for every + # parameters, not just the timezone. + # The call to get_server_timezone() sets the timezone; this should + # probably done here. if self.options['timezone']: + # Prevent the timezone to be True. (The config file parsing changes + # the string 'True' to the boolean value True. It would be probably + # be better to remove that conversion.) + die(not isinstance(self.options['timezone'], basestring), + "Invalid timezone value in configuration or environment: %r.\n" + "Please fix this in your configuration." %(self.options['timezone'])) + # If an explicit TZ was provided in the config, make sure it is known try: import pytz diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index 1524d95d922..e1a6a717e87 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -159,7 +159,7 @@ def exec_pg_command(name, *args): if not prog: raise Exception('Couldn\'t find %s' % name) args2 = (prog,) + args - + return subprocess.call(args2) def exec_pg_command_pipe(name, *args):