diff options
author | Christian Goetze <cg@lindenlab.com> | 2008-07-10 16:52:33 +0000 |
---|---|---|
committer | Christian Goetze <cg@lindenlab.com> | 2008-07-10 16:52:33 +0000 |
commit | 40d2bb564d35809d7735d2ec06ba988db7327020 (patch) | |
tree | d87f4272d64706fdd28ecdf0fe731bf20bbcfe26 /indra | |
parent | 81443ef2aa7bdb916eb4b38740db9ae3cd1c59cd (diff) |
QAR-622 merge -r91846:91877 svn+ssh://svn/svn/linden/branches/scut-newstyle-5
Diffstat (limited to 'indra')
-rw-r--r-- | indra/lib/python/indra/base/config.py | 7 | ||||
-rw-r--r-- | indra/lib/python/indra/ipc/mysql_pool.py | 12 | ||||
-rw-r--r-- | indra/lib/python/indra/util/named_query.py | 2 | ||||
-rw-r--r-- | indra/test/CMakeLists.txt | 1 |
4 files changed, 20 insertions, 2 deletions
diff --git a/indra/lib/python/indra/base/config.py b/indra/lib/python/indra/base/config.py index 9d8da7dd15..1649933d37 100644 --- a/indra/lib/python/indra/base/config.py +++ b/indra/lib/python/indra/base/config.py @@ -175,7 +175,12 @@ def load(indra_xml_file = None): indra_xml_file = realpath( dirname(realpath(__file__)) + "../../../../../../etc/indra.xml") - _g_config = IndraConfig(indra_xml_file) + try: + _g_config = IndraConfig(indra_xml_file) + except IOError: + # indra.xml was not openable, so let's initialize with an empty dict + # some code relies on config behaving this way + _g_config = IndraConfig(None) def dump(indra_xml_file, indra_cfg = None, update_in_mem=False): ''' diff --git a/indra/lib/python/indra/ipc/mysql_pool.py b/indra/lib/python/indra/ipc/mysql_pool.py index 2a5a916e74..a2324cf956 100644 --- a/indra/lib/python/indra/ipc/mysql_pool.py +++ b/indra/lib/python/indra/ipc/mysql_pool.py @@ -76,3 +76,15 @@ class ConnectionPool(db_pool.TpooledConnectionPool): converted_kwargs.update(self._kwargs) conn.connection_parameters = converted_kwargs return conn + + def clear(self): + """ Close all connections that this pool still holds a reference to, leaving it empty.""" + for conn in self.free_items: + try: + conn.close() + except: + pass # even if stuff happens here, we still want to at least try to close all the other connections + self.free_items.clear() + + def __del__(self): + self.clear() diff --git a/indra/lib/python/indra/util/named_query.py b/indra/lib/python/indra/util/named_query.py index 063ef7932e..483a9606c8 100644 --- a/indra/lib/python/indra/util/named_query.py +++ b/indra/lib/python/indra/util/named_query.py @@ -47,7 +47,7 @@ except NameError: from indra.base import llsd from indra.base import config -NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '') +NQ_FILE_SUFFIX = config.get('named-query-file-suffix', '.nq') NQ_FILE_SUFFIX_LEN = len(NQ_FILE_SUFFIX) _g_named_manager = None diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 63e5538388..03c4731de5 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -140,6 +140,7 @@ if (EXISTS /etc/debian_version_FAIL) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/test.py + --mode=static --output=${CMAKE_CURRENT_BINARY_DIR}/py_test_results.txt --touch=${CMAKE_CURRENT_BINARY_DIR}/py_tests_ok.txt DEPENDS test.py |