diff --git a/aodh/storage/hbase/base.py b/aodh/storage/hbase/base.py index 0d1fcfd06..d6f363e30 100644 --- a/aodh/storage/hbase/base.py +++ b/aodh/storage/hbase/base.py @@ -11,8 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -import os - import happybase from oslo_log import log from oslo_utils import netutils @@ -33,19 +31,12 @@ class Connection(object): opts = self._parse_connection_url(url) if opts['host'] == '__test__': - url = os.environ.get('AODH_TEST_STORAGE_URL') - if url: - # Reparse URL, but from the env variable now - opts = self._parse_connection_url(url) - self.conn_pool = self._get_connection_pool(opts) - else: - # This is a in-memory usage for unit tests - if Connection._memory_instance is None: - LOG.debug('Creating a new in-memory HBase Connection ' - 'object') - Connection._memory_instance = (hbase_inmemory. - MConnectionPool()) - self.conn_pool = Connection._memory_instance + # This is a in-memory usage for unit tests + if Connection._memory_instance is None: + LOG.debug('Creating a new in-memory HBase Connection object') + Connection._memory_instance = (hbase_inmemory. + MConnectionPool()) + self.conn_pool = Connection._memory_instance else: self.conn_pool = self._get_connection_pool(opts) diff --git a/tox.ini b/tox.ini index d6bd77568..57abb8165 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,10 @@ whitelist_externals = bash # set environment variable OS_TEST_PATH=./aodh/tests/functional # in "py-" jobs +[testenv:py27-hbase] +setenv = OS_TEST_PATH=aodh/tests/functional/ + AODH_TEST_STORAGE_URL=hbase://__test__ + [testenv:py27-mongodb] setenv = OS_TEST_PATH=aodh/tests/functional/ commands =