Remove null drivers

There are not used anywhere nor really useful.

Change-Id: I86061a4d82ae5eddee18971478431475b8131f96
This commit is contained in:
Julien Danjou 2016-08-16 15:30:46 +02:00
parent f1f81c552b
commit 9c0a918a65
6 changed files with 10 additions and 57 deletions

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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)
if self.tmp_dir:
shutil.rmtree(self.tmp_dir)

View File

@ -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):

View File

@ -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