diff --git a/gnocchi/indexer/null.py b/gnocchi/indexer/null.py deleted file mode 100644 index 850e2aeb8..000000000 --- a/gnocchi/indexer/null.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding: utf-8 -*- -# -# Copyright © 2014 eNovance -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from gnocchi import indexer - - -class NullIndexer(indexer.IndexerDriver): - pass diff --git a/gnocchi/storage/null.py b/gnocchi/storage/null.py deleted file mode 100644 index 21eed341c..000000000 --- a/gnocchi/storage/null.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding: utf-8 -*- -# -# Copyright © 2014-2015 eNovance -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from gnocchi import storage - - -class NullStorage(storage.StorageDriver): - pass diff --git a/gnocchi/tests/base.py b/gnocchi/tests/base.py index 298dcf9e5..2d614c846 100644 --- a/gnocchi/tests/base.py +++ b/gnocchi/tests/base.py @@ -436,7 +436,7 @@ class TestCase(base.BaseTestCase): self.conf.set_override( 'driver', - os.getenv("GNOCCHI_TEST_STORAGE_DRIVER", "null"), + os.getenv("GNOCCHI_TEST_STORAGE_DRIVER", "file"), 'storage') def setUp(self): diff --git a/gnocchi/tests/gabbi/fixtures.py b/gnocchi/tests/gabbi/fixtures.py index 1d94bec42..df83524fe 100644 --- a/gnocchi/tests/gabbi/fixtures.py +++ b/gnocchi/tests/gabbi/fixtures.py @@ -83,10 +83,7 @@ class ConfigFixture(fixture.GabbiFixture): self.conf = conf self.tmp_dir = data_tmp_dir - # TODO(jd) It would be cool if Gabbi was able to use the null:// - # indexer, but this makes the API returns a lot of 501 error, which - # Gabbi does not want to see, so let's just disable it. - if conf.indexer.url is None or conf.indexer.url == "null://": + if conf.indexer.url is None: raise case.SkipTest("No indexer configured") # Use the presence of DEVSTACK_GATE_TEMPEST as a semaphore @@ -141,13 +138,13 @@ class ConfigFixture(fixture.GabbiFixture): if hasattr(self, 'index'): self.index.disconnect() - if not self.conf.indexer.url.startswith("null://"): - # Swallow noise from missing tables when dropping - # database. - with warnings.catch_warnings(): - warnings.filterwarnings('ignore', - module='sqlalchemy.engine.default') - sqlalchemy_utils.drop_database(self.conf.indexer.url) + # Swallow noise from missing tables when dropping + # database. + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', + module='sqlalchemy.engine.default') + sqlalchemy_utils.drop_database(self.conf.indexer.url) + if self.tmp_dir: shutil.rmtree(self.tmp_dir) diff --git a/gnocchi/tests/test_storage.py b/gnocchi/tests/test_storage.py index f5b48f6dc..4aa6bd60d 100644 --- a/gnocchi/tests/test_storage.py +++ b/gnocchi/tests/test_storage.py @@ -26,7 +26,6 @@ from gnocchi import carbonara from gnocchi import indexer from gnocchi import storage from gnocchi.storage import _carbonara -from gnocchi.storage import null from gnocchi.tests import base as tests_base from gnocchi import utils @@ -52,9 +51,8 @@ class TestStorageDriver(tests_base.TestCase): storage.process_background_tasks(index, metrics, sync=True) def test_get_driver(self): - self.conf.set_override('driver', 'null', 'storage') driver = storage.get_driver(self.conf) - self.assertIsInstance(driver, null.NullStorage) + self.assertIsInstance(driver, storage.StorageDriver) def test_corrupted_data(self): if not isinstance(self.storage, _carbonara.CarbonaraBasedStorage): diff --git a/setup.cfg b/setup.cfg index 4b0f37838..812a88a11 100644 --- a/setup.cfg +++ b/setup.cfg @@ -97,13 +97,11 @@ gnocchi.indexer.sqlalchemy.resource_type_attribute = bool = gnocchi.indexer.sqlalchemy_extension:BoolSchema gnocchi.storage = - null = gnocchi.storage.null:NullStorage swift = gnocchi.storage.swift:SwiftStorage ceph = gnocchi.storage.ceph:CephStorage file = gnocchi.storage.file:FileStorage gnocchi.indexer = - null = gnocchi.indexer.null:NullIndexer mysql = gnocchi.indexer.sqlalchemy:SQLAlchemyIndexer mysql+pymysql = gnocchi.indexer.sqlalchemy:SQLAlchemyIndexer postgresql = gnocchi.indexer.sqlalchemy:SQLAlchemyIndexer