From f7ae63c6f5a8841118952a113709d3f774bfd8a6 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Sat, 12 Jan 2013 18:20:52 +0200 Subject: [PATCH] Remove unsused imports in the plugins package Config imports are needed for correct init quota_db is required to make sure quota database model at the proper timing Change-Id: I885ed1f673cfc4c6331818ad68e2a505f7d69188 --- quantum/plugins/bigswitch/plugin.py | 1 - quantum/plugins/bigswitch/tests/test_server.py | 1 - quantum/plugins/cisco/db/network_db_v2.py | 3 --- quantum/plugins/cisco/db/ucs_models_v2.py | 2 -- quantum/plugins/cisco/models/virt_phy_sw_v2.py | 1 - quantum/plugins/cisco/network_plugin.py | 1 - quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py | 1 - .../cisco/tests/unit/v2/ucs/cisco_ucs_inventory_fake.py | 1 - .../plugins/cisco/tests/unit/v2/ucs/test_ucs_inventory_v2.py | 1 - .../plugins/linuxbridge/agent/linuxbridge_quantum_agent.py | 1 + quantum/plugins/linuxbridge/db/l2network_db_v2.py | 2 +- quantum/plugins/linuxbridge/lb_quantum_plugin.py | 1 + quantum/plugins/metaplugin/meta_db_v2.py | 1 - quantum/plugins/metaplugin/meta_quantum_plugin.py | 4 +--- quantum/plugins/metaplugin/proxy_quantum_plugin.py | 1 - quantum/plugins/metaplugin/run_tests.py | 1 - quantum/plugins/nec/db/api.py | 1 + quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py | 2 +- quantum/plugins/openvswitch/ovs_quantum_plugin.py | 1 + 19 files changed, 7 insertions(+), 20 deletions(-) diff --git a/quantum/plugins/bigswitch/plugin.py b/quantum/plugins/bigswitch/plugin.py index 67b41dff8b..511ce29343 100644 --- a/quantum/plugins/bigswitch/plugin.py +++ b/quantum/plugins/bigswitch/plugin.py @@ -56,7 +56,6 @@ from quantum import context as qcontext from quantum.db import api as db from quantum.db import db_base_plugin_v2 from quantum.db import dhcp_rpc_base -from quantum.db import models_v2 from quantum.openstack.common import cfg from quantum.openstack.common import log as logging from quantum.openstack.common import rpc diff --git a/quantum/plugins/bigswitch/tests/test_server.py b/quantum/plugins/bigswitch/tests/test_server.py index 8ae5e0b28e..43c738bc03 100755 --- a/quantum/plugins/bigswitch/tests/test_server.py +++ b/quantum/plugins/bigswitch/tests/test_server.py @@ -26,7 +26,6 @@ import json import re from wsgiref.simple_server import make_server -from wsgiref.util import request_uri, application_uri class TestNetworkCtrl(object): diff --git a/quantum/plugins/cisco/db/network_db_v2.py b/quantum/plugins/cisco/db/network_db_v2.py index 0c3bea8ef1..d04985d875 100644 --- a/quantum/plugins/cisco/db/network_db_v2.py +++ b/quantum/plugins/cisco/db/network_db_v2.py @@ -21,11 +21,8 @@ from sqlalchemy.orm import exc from quantum.common import exceptions as q_exc from quantum.db import api as db -from quantum.db import models_v2 -from quantum.plugins.cisco.common import cisco_constants as const from quantum.plugins.cisco.common import cisco_exceptions as c_exc from quantum.plugins.cisco.db import network_models_v2 -from quantum.plugins.cisco.db import nexus_models_v2 from quantum.plugins.cisco.db import ucs_models_v2 from quantum.plugins.cisco import l2network_plugin_configuration as conf from quantum.plugins.openvswitch import ovs_models_v2 diff --git a/quantum/plugins/cisco/db/ucs_models_v2.py b/quantum/plugins/cisco/db/ucs_models_v2.py index a6c7919208..d2d1ccc1a3 100644 --- a/quantum/plugins/cisco/db/ucs_models_v2.py +++ b/quantum/plugins/cisco/db/ucs_models_v2.py @@ -16,10 +16,8 @@ # @author: Rohit Agarwalla, Cisco Systems, Inc. from sqlalchemy import Column, Integer, String -from sqlalchemy.orm import relation from quantum.db.model_base import BASEV2 as BASE -from quantum.db import models_v2 as models from quantum.plugins.cisco.db.network_models_v2 import L2NetworkBase diff --git a/quantum/plugins/cisco/models/virt_phy_sw_v2.py b/quantum/plugins/cisco/models/virt_phy_sw_v2.py index d77527f265..b46aa4bc17 100644 --- a/quantum/plugins/cisco/models/virt_phy_sw_v2.py +++ b/quantum/plugins/cisco/models/virt_phy_sw_v2.py @@ -21,7 +21,6 @@ from copy import deepcopy import inspect import logging -from quantum.db import l3_db from quantum.manager import QuantumManager from quantum.openstack.common import importutils from quantum.plugins.cisco.common import cisco_constants as const diff --git a/quantum/plugins/cisco/network_plugin.py b/quantum/plugins/cisco/network_plugin.py index 05edc4c537..8648071b46 100644 --- a/quantum/plugins/cisco/network_plugin.py +++ b/quantum/plugins/cisco/network_plugin.py @@ -26,7 +26,6 @@ from quantum.db import db_base_plugin_v2 from quantum.db import models_v2 from quantum.openstack.common import importutils from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_credentials_v2 as cred from quantum.plugins.cisco.common import cisco_exceptions as cexc from quantum.plugins.cisco.common import cisco_utils as cutil from quantum.plugins.cisco.db import network_db_v2 as cdb diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py b/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py index d73a70c111..447faf466b 100644 --- a/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py +++ b/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py @@ -23,7 +23,6 @@ PlugIn for Nexus OS driver import logging from quantum.common import exceptions as exc -from quantum.db import api as db from quantum.openstack.common import importutils from quantum.plugins.cisco.common import cisco_constants as const from quantum.plugins.cisco.common import cisco_credentials_v2 as cred diff --git a/quantum/plugins/cisco/tests/unit/v2/ucs/cisco_ucs_inventory_fake.py b/quantum/plugins/cisco/tests/unit/v2/ucs/cisco_ucs_inventory_fake.py index fd436bdc7c..9fa2dfc0c2 100644 --- a/quantum/plugins/cisco/tests/unit/v2/ucs/cisco_ucs_inventory_fake.py +++ b/quantum/plugins/cisco/tests/unit/v2/ucs/cisco_ucs_inventory_fake.py @@ -20,7 +20,6 @@ import logging import os -from quantum.common.utils import find_config_file from quantum.openstack.common import importutils from quantum.plugins.cisco.common import cisco_configparser as confp from quantum.plugins.cisco.common import cisco_constants as const diff --git a/quantum/plugins/cisco/tests/unit/v2/ucs/test_ucs_inventory_v2.py b/quantum/plugins/cisco/tests/unit/v2/ucs/test_ucs_inventory_v2.py index 1d16a190b2..22f2073e2e 100644 --- a/quantum/plugins/cisco/tests/unit/v2/ucs/test_ucs_inventory_v2.py +++ b/quantum/plugins/cisco/tests/unit/v2/ucs/test_ucs_inventory_v2.py @@ -20,7 +20,6 @@ import logging import unittest -from quantum.common import exceptions as exc from quantum.openstack.common import uuidutils from quantum.plugins.cisco.common import cisco_constants as const from quantum.plugins.cisco.common import cisco_credentials_v2 as creds diff --git a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py b/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py index 8f855b2eb6..94346c2d4e 100755 --- a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py +++ b/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py @@ -40,6 +40,7 @@ from quantum import context from quantum.openstack.common import cfg from quantum.openstack.common import log as logging from quantum.openstack.common.rpc import dispatcher +# NOTE (e0ne): this import is needed for config init from quantum.plugins.linuxbridge.common import config from quantum.plugins.linuxbridge.common import constants as lconst diff --git a/quantum/plugins/linuxbridge/db/l2network_db_v2.py b/quantum/plugins/linuxbridge/db/l2network_db_v2.py index ebe27a45bd..133f2a3cdd 100644 --- a/quantum/plugins/linuxbridge/db/l2network_db_v2.py +++ b/quantum/plugins/linuxbridge/db/l2network_db_v2.py @@ -21,8 +21,8 @@ import quantum.db.api as db from quantum import manager from quantum.db import models_v2 from quantum.db import securitygroups_db as sg_db -from quantum.openstack.common import cfg from quantum.openstack.common import log as logging +# NOTE (e0ne): this import is needed for config init from quantum.plugins.linuxbridge.common import config from quantum.plugins.linuxbridge.common import constants from quantum.plugins.linuxbridge.db import l2network_models_v2 diff --git a/quantum/plugins/linuxbridge/lb_quantum_plugin.py b/quantum/plugins/linuxbridge/lb_quantum_plugin.py index 4267d9ac01..9b87398bd6 100644 --- a/quantum/plugins/linuxbridge/lb_quantum_plugin.py +++ b/quantum/plugins/linuxbridge/lb_quantum_plugin.py @@ -27,6 +27,7 @@ from quantum.db import db_base_plugin_v2 from quantum.db import dhcp_rpc_base from quantum.db import l3_db from quantum.db import l3_rpc_base +# NOTE: quota_db cannot be removed, it is for db model from quantum.db import quota_db from quantum.db import securitygroups_rpc_base as sg_db_rpc from quantum.extensions import portbindings diff --git a/quantum/plugins/metaplugin/meta_db_v2.py b/quantum/plugins/metaplugin/meta_db_v2.py index fd32b43c68..7f03fd259a 100644 --- a/quantum/plugins/metaplugin/meta_db_v2.py +++ b/quantum/plugins/metaplugin/meta_db_v2.py @@ -17,7 +17,6 @@ from sqlalchemy.orm import exc -import quantum.db.api as db from quantum.plugins.metaplugin import meta_models_v2 diff --git a/quantum/plugins/metaplugin/meta_quantum_plugin.py b/quantum/plugins/metaplugin/meta_quantum_plugin.py index 0af8ab7b7c..6312f72ed8 100644 --- a/quantum/plugins/metaplugin/meta_quantum_plugin.py +++ b/quantum/plugins/metaplugin/meta_quantum_plugin.py @@ -15,9 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.api.v2 import attributes from quantum.common import exceptions as exc -from quantum.common.utils import find_config_file from quantum.db import api as db from quantum.db import db_base_plugin_v2 from quantum.db import l3_db @@ -26,11 +24,11 @@ from quantum.extensions.flavor import (FLAVOR_NETWORK, FLAVOR_ROUTER) from quantum.openstack.common import cfg from quantum.openstack.common import importutils from quantum.openstack.common import log as logging +# NOTE (e0ne): this import is needed for config init from quantum.plugins.metaplugin.common import config from quantum.plugins.metaplugin import meta_db_v2 from quantum.plugins.metaplugin.meta_models_v2 import (NetworkFlavor, RouterFlavor) -from quantum import policy LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/metaplugin/proxy_quantum_plugin.py b/quantum/plugins/metaplugin/proxy_quantum_plugin.py index b9c3c991ef..9217b76468 100644 --- a/quantum/plugins/metaplugin/proxy_quantum_plugin.py +++ b/quantum/plugins/metaplugin/proxy_quantum_plugin.py @@ -18,7 +18,6 @@ from quantum.db import api as db from quantum.db import db_base_plugin_v2 from quantum.db import l3_db -from quantum.db import models_v2 from quantum.openstack.common import cfg from quantum.openstack.common import log as logging from quantumclient.common import exceptions diff --git a/quantum/plugins/metaplugin/run_tests.py b/quantum/plugins/metaplugin/run_tests.py index 0576f1186a..50e36da30a 100755 --- a/quantum/plugins/metaplugin/run_tests.py +++ b/quantum/plugins/metaplugin/run_tests.py @@ -29,7 +29,6 @@ import os import sys from nose import config -from nose import core sys.path.append(os.getcwd()) sys.path.append(os.path.dirname(__file__)) diff --git a/quantum/plugins/nec/db/api.py b/quantum/plugins/nec/db/api.py index 466bf6fd14..7eb822da56 100644 --- a/quantum/plugins/nec/db/api.py +++ b/quantum/plugins/nec/db/api.py @@ -20,6 +20,7 @@ import sqlalchemy as sa from quantum.db import api as db from quantum.db import model_base from quantum.openstack.common import log as logging +# NOTE (e0ne): this import is needed for config init from quantum.plugins.nec.common import config from quantum.plugins.nec.common import exceptions as nexc from quantum.plugins.nec.db import models as nmodels diff --git a/quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py b/quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py index 65fcf8c979..62a01596f7 100644 --- a/quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py +++ b/quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py @@ -34,7 +34,7 @@ from quantum.common import topics from quantum.db import api as db from quantum.db import db_base_plugin_v2 from quantum.db import dhcp_rpc_base -from quantum.db import models_v2 +# NOTE: quota_db cannot be removed, it is for db model from quantum.db import quota_db from quantum.extensions import providernet as pnet from quantum.openstack.common import cfg diff --git a/quantum/plugins/openvswitch/ovs_quantum_plugin.py b/quantum/plugins/openvswitch/ovs_quantum_plugin.py index 6722f4676a..642b861d18 100644 --- a/quantum/plugins/openvswitch/ovs_quantum_plugin.py +++ b/quantum/plugins/openvswitch/ovs_quantum_plugin.py @@ -31,6 +31,7 @@ from quantum.db import db_base_plugin_v2 from quantum.db import dhcp_rpc_base from quantum.db import l3_db from quantum.db import l3_rpc_base +# NOTE: quota_db cannot be removed, it is for db model from quantum.db import quota_db from quantum.extensions import portbindings from quantum.extensions import providernet as provider