From fdc2c5d86a85410a587cbf89bd59f798db70d0aa Mon Sep 17 00:00:00 2001 From: Michael Still Date: Tue, 16 Feb 2016 11:24:43 +1100 Subject: [PATCH] Cleanup unused conf variables I noticed in nova that we had a lot of unused conf variables. I wondered if this was a thing in other projects as well. Turns out it is. Change-Id: I2424e32dd4ad61881d9b6a0449e12937ea8151e0 --- cinder/api/contrib/volume_manage.py | 2 -- cinder/objects/service.py | 2 -- cinder/objects/volume_attachment.py | 2 -- cinder/objects/volume_type.py | 2 -- cinder/replication/api.py | 2 -- cinder/tests/unit/api/contrib/test_volume_actions.py | 3 --- cinder/tests/unit/api/v1/test_snapshot_metadata.py | 4 ---- cinder/tests/unit/api/v2/test_snapshot_metadata.py | 4 ---- cinder/tests/unit/backup/drivers/test_backup_glusterfs.py | 3 --- cinder/tests/unit/backup/test_rpcapi.py | 4 ---- cinder/tests/unit/db/test_volume_type.py | 4 ---- cinder/tests/unit/scheduler/test_rpcapi.py | 4 ---- cinder/tests/unit/test_db_api.py | 3 --- cinder/tests/unit/test_hpe_xp_fc.py | 2 -- cinder/tests/unit/test_ibm_xiv_ds8k.py | 3 --- cinder/tests/unit/test_netapp_nfs.py | 4 ---- cinder/tests/unit/test_volume_throttling.py | 4 ---- cinder/tests/unit/volume/flows/test_create_volume_flow.py | 4 ---- cinder/volume/qos_specs.py | 2 -- cinder/wsgi/common.py | 2 -- 20 files changed, 60 deletions(-) diff --git a/cinder/api/contrib/volume_manage.py b/cinder/api/contrib/volume_manage.py index 819e5fad1..098da3a42 100644 --- a/cinder/api/contrib/volume_manage.py +++ b/cinder/api/contrib/volume_manage.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_log import log as logging from oslo_utils import uuidutils from webob import exc @@ -28,7 +27,6 @@ from cinder import volume as cinder_volume from cinder.volume import volume_types LOG = logging.getLogger(__name__) -CONF = cfg.CONF authorize = extensions.extension_authorizer('volume', 'volume_manage') diff --git a/cinder/objects/service.py b/cinder/objects/service.py index 8f28bfa67..f7f4c0ff2 100644 --- a/cinder/objects/service.py +++ b/cinder/objects/service.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_log import log as logging from oslo_utils import versionutils from oslo_versionedobjects import fields @@ -24,7 +23,6 @@ from cinder import objects from cinder.objects import base from cinder import utils -CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/cinder/objects/volume_attachment.py b/cinder/objects/volume_attachment.py index fcb82ccf4..958fbf79d 100644 --- a/cinder/objects/volume_attachment.py +++ b/cinder/objects/volume_attachment.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_log import log as logging from oslo_versionedobjects import fields @@ -20,7 +19,6 @@ from cinder import db from cinder import objects from cinder.objects import base -CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/cinder/objects/volume_type.py b/cinder/objects/volume_type.py index 1f6fcf0d4..646796722 100644 --- a/cinder/objects/volume_type.py +++ b/cinder/objects/volume_type.py @@ -12,7 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_log import log as logging from oslo_versionedobjects import fields @@ -22,7 +21,6 @@ from cinder import objects from cinder.objects import base from cinder.volume import volume_types -CONF = cfg.CONF OPTIONAL_FIELDS = ['extra_specs', 'projects'] LOG = logging.getLogger(__name__) diff --git a/cinder/replication/api.py b/cinder/replication/api.py index 199dbd0e5..39022d098 100644 --- a/cinder/replication/api.py +++ b/cinder/replication/api.py @@ -17,7 +17,6 @@ Handles all requests relating to volume replication. """ import functools -from oslo_config import cfg from oslo_log import log as logging from cinder.db import base @@ -28,7 +27,6 @@ from cinder import volume as cinder_volume from cinder.volume import rpcapi as volume_rpcapi from cinder.volume import utils as volume_utils -CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/cinder/tests/unit/api/contrib/test_volume_actions.py b/cinder/tests/unit/api/contrib/test_volume_actions.py index 3fc1b2f98..d662bce45 100644 --- a/cinder/tests/unit/api/contrib/test_volume_actions.py +++ b/cinder/tests/unit/api/contrib/test_volume_actions.py @@ -18,7 +18,6 @@ import json import uuid import mock -from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils import webob @@ -36,8 +35,6 @@ from cinder import volume from cinder.volume import api as volume_api from cinder.volume import rpcapi as volume_rpcapi -CONF = cfg.CONF - class VolumeActionsTest(test.TestCase): diff --git a/cinder/tests/unit/api/v1/test_snapshot_metadata.py b/cinder/tests/unit/api/v1/test_snapshot_metadata.py index cfcbb39b8..9b0a39413 100644 --- a/cinder/tests/unit/api/v1/test_snapshot_metadata.py +++ b/cinder/tests/unit/api/v1/test_snapshot_metadata.py @@ -16,7 +16,6 @@ import uuid import mock -from oslo_config import cfg from oslo_serialization import jsonutils import webob @@ -33,9 +32,6 @@ from cinder.tests.unit import fake_volume from cinder import volume -CONF = cfg.CONF - - def return_create_snapshot_metadata(context, snapshot_id, metadata, delete): return stub_snapshot_metadata() diff --git a/cinder/tests/unit/api/v2/test_snapshot_metadata.py b/cinder/tests/unit/api/v2/test_snapshot_metadata.py index c3676c0f9..605efdea4 100644 --- a/cinder/tests/unit/api/v2/test_snapshot_metadata.py +++ b/cinder/tests/unit/api/v2/test_snapshot_metadata.py @@ -16,7 +16,6 @@ import uuid import mock -from oslo_config import cfg from oslo_serialization import jsonutils import webob @@ -33,9 +32,6 @@ from cinder.tests.unit import fake_volume from cinder import volume -CONF = cfg.CONF - - def return_create_snapshot_metadata(context, snapshot_id, metadata, delete): return stub_snapshot_metadata() diff --git a/cinder/tests/unit/backup/drivers/test_backup_glusterfs.py b/cinder/tests/unit/backup/drivers/test_backup_glusterfs.py index a60b06f9d..68d05297b 100644 --- a/cinder/tests/unit/backup/drivers/test_backup_glusterfs.py +++ b/cinder/tests/unit/backup/drivers/test_backup_glusterfs.py @@ -20,7 +20,6 @@ import os import mock from os_brick.remotefs import remotefs as remotefs_brick -from oslo_config import cfg from cinder.backup.drivers import glusterfs from cinder import context @@ -28,8 +27,6 @@ from cinder import exception from cinder import test from cinder import utils -CONF = cfg.CONF - FAKE_BACKUP_MOUNT_POINT_BASE = '/fake/mount-point-base' FAKE_HOST = 'fake_host' FAKE_VOL_NAME = 'backup_vol' diff --git a/cinder/tests/unit/backup/test_rpcapi.py b/cinder/tests/unit/backup/test_rpcapi.py index 4354a8194..d3c347ce2 100644 --- a/cinder/tests/unit/backup/test_rpcapi.py +++ b/cinder/tests/unit/backup/test_rpcapi.py @@ -19,7 +19,6 @@ Unit Tests for cinder.backup.rpcapi import copy import mock -from oslo_config import cfg from cinder.backup import rpcapi as backup_rpcapi from cinder import context @@ -28,9 +27,6 @@ from cinder import test from cinder.tests.unit import fake_backup -CONF = cfg.CONF - - class BackupRpcAPITestCase(test.TestCase): def setUp(self): super(BackupRpcAPITestCase, self).setUp() diff --git a/cinder/tests/unit/db/test_volume_type.py b/cinder/tests/unit/db/test_volume_type.py index f87db1eeb..9d748cebd 100644 --- a/cinder/tests/unit/db/test_volume_type.py +++ b/cinder/tests/unit/db/test_volume_type.py @@ -14,15 +14,11 @@ """Tests for volume type.""" -from oslo_config import cfg - from cinder import context from cinder import db from cinder import test from cinder.volume import volume_types -CONF = cfg.CONF - class VolumeTypeTestCase(test.TestCase): """Test cases for volume type.""" diff --git a/cinder/tests/unit/scheduler/test_rpcapi.py b/cinder/tests/unit/scheduler/test_rpcapi.py index dd2f875a5..370d617bf 100644 --- a/cinder/tests/unit/scheduler/test_rpcapi.py +++ b/cinder/tests/unit/scheduler/test_rpcapi.py @@ -20,16 +20,12 @@ Unit Tests for cinder.scheduler.rpcapi import copy import mock -from oslo_config import cfg from cinder import context from cinder.scheduler import rpcapi as scheduler_rpcapi from cinder import test -CONF = cfg.CONF - - class SchedulerRpcAPITestCase(test.TestCase): def setUp(self): diff --git a/cinder/tests/unit/test_db_api.py b/cinder/tests/unit/test_db_api.py index ed3215378..0307ad350 100644 --- a/cinder/tests/unit/test_db_api.py +++ b/cinder/tests/unit/test_db_api.py @@ -18,7 +18,6 @@ import datetime import enum import mock -from oslo_config import cfg from oslo_utils import uuidutils import six @@ -30,8 +29,6 @@ from cinder import exception from cinder import quota from cinder import test -CONF = cfg.CONF - THREE = 3 THREE_HUNDREDS = 300 ONE_HUNDREDS = 100 diff --git a/cinder/tests/unit/test_hpe_xp_fc.py b/cinder/tests/unit/test_hpe_xp_fc.py index 97635accc..248effba7 100644 --- a/cinder/tests/unit/test_hpe_xp_fc.py +++ b/cinder/tests/unit/test_hpe_xp_fc.py @@ -25,9 +25,7 @@ from cinder.volume import driver from cinder.volume.drivers.hpe import hpe_xp_fc from cinder.volume.drivers.hpe import hpe_xp_opts -from oslo_config import cfg from oslo_utils import importutils -CONF = cfg.CONF NORMAL_LDEV_TYPE = 'Normal' POOL_INFO = {'30': {'total_gb': 'infinite', 'free_gb': 'infinite'}} diff --git a/cinder/tests/unit/test_ibm_xiv_ds8k.py b/cinder/tests/unit/test_ibm_xiv_ds8k.py index 3e6be8a9e..df73e6207 100644 --- a/cinder/tests/unit/test_ibm_xiv_ds8k.py +++ b/cinder/tests/unit/test_ibm_xiv_ds8k.py @@ -22,7 +22,6 @@ import copy from mox3 import mox -from oslo_config import cfg from cinder import context from cinder import exception @@ -82,8 +81,6 @@ CG_SNAPSHOT = {'id': CG_SNAPSHOT_ID, CONNECTOR = {'initiator': "iqn.2012-07.org.fake:01:948f189c4695", } -CONF = cfg.CONF - class XIVDS8KFakeProxyDriver(object): """Fake IBM XIV and DS8K Proxy Driver.""" diff --git a/cinder/tests/unit/test_netapp_nfs.py b/cinder/tests/unit/test_netapp_nfs.py index 19e013607..2f0504572 100644 --- a/cinder/tests/unit/test_netapp_nfs.py +++ b/cinder/tests/unit/test_netapp_nfs.py @@ -42,10 +42,6 @@ from cinder.volume.drivers.netapp.dataontap import nfs_base from cinder.volume.drivers.netapp.dataontap import ssc_cmode from cinder.volume.drivers.netapp import utils -from oslo_config import cfg - - -CONF = cfg.CONF CONNECTION_INFO = { 'hostname': 'fake_host', diff --git a/cinder/tests/unit/test_volume_throttling.py b/cinder/tests/unit/test_volume_throttling.py index 77f154375..82e264557 100644 --- a/cinder/tests/unit/test_volume_throttling.py +++ b/cinder/tests/unit/test_volume_throttling.py @@ -16,16 +16,12 @@ """Tests for volume copy throttling helpers.""" import mock -from oslo_config import cfg from cinder import test from cinder import utils from cinder.volume import throttling -CONF = cfg.CONF - - class ThrottleTestCase(test.TestCase): def test_NoThrottle(self): diff --git a/cinder/tests/unit/volume/flows/test_create_volume_flow.py b/cinder/tests/unit/volume/flows/test_create_volume_flow.py index d4b9f0379..4302611b1 100644 --- a/cinder/tests/unit/volume/flows/test_create_volume_flow.py +++ b/cinder/tests/unit/volume/flows/test_create_volume_flow.py @@ -17,8 +17,6 @@ import ddt import mock -from oslo_config import cfg - from cinder import context from cinder import exception from cinder.openstack.common import imageutils @@ -33,8 +31,6 @@ from cinder.tests.unit.volume.flows import fake_volume_api from cinder.volume.flows.api import create_volume from cinder.volume.flows.manager import create_volume as create_volume_manager -CONF = cfg.CONF - @ddt.ddt class CreateVolumeFlowTestCase(test.TestCase): diff --git a/cinder/volume/qos_specs.py b/cinder/volume/qos_specs.py index 529be993f..52527d78e 100644 --- a/cinder/volume/qos_specs.py +++ b/cinder/volume/qos_specs.py @@ -16,7 +16,6 @@ """The QoS Specs Implementation""" -from oslo_config import cfg from oslo_db import exception as db_exc from oslo_log import log as logging @@ -27,7 +26,6 @@ from cinder.i18n import _, _LE, _LW from cinder.volume import volume_types -CONF = cfg.CONF LOG = logging.getLogger(__name__) CONTROL_LOCATION = ['front-end', 'back-end', 'both'] diff --git a/cinder/wsgi/common.py b/cinder/wsgi/common.py index 4da4ffa0b..0eb47e1a0 100644 --- a/cinder/wsgi/common.py +++ b/cinder/wsgi/common.py @@ -14,14 +14,12 @@ """Utility methods for working with WSGI servers.""" -from oslo_config import cfg from oslo_log import log as logging import webob.dec import webob.exc from cinder.i18n import _ -CONF = cfg.CONF LOG = logging.getLogger(__name__) -- 2.45.2