From: Kevin Benton Date: Mon, 31 Aug 2015 17:22:50 +0000 (-0700) Subject: Rename 'newapi' to 'pecan_wsgi' X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=be9bff66be7939b42cea47675f6c0542003a8c54;p=openstack-build%2Fneutron-build.git Rename 'newapi' to 'pecan_wsgi' 'newapi' was too generic and not really descriptive of the conversion to pecan. Since there isn't any ambiguity, we will just keep all of the pecan components in a directory called 'pecan_wsgi'. Change-Id: I61f1cfcad4ff00582e0a481400642dd656d5245e --- diff --git a/neutron/cmd/eventlet/api.py b/neutron/cmd/eventlet/api.py index bdedd2690..00a055041 100644 --- a/neutron/cmd/eventlet/api.py +++ b/neutron/cmd/eventlet/api.py @@ -26,7 +26,7 @@ from oslo_log import log as logging from six.moves import socketserver from neutron.common import config -from neutron.newapi import app +from neutron.pecan_wsgi import app from neutron.i18n import _LI, _LW diff --git a/neutron/newapi/__init__.py b/neutron/pecan_wsgi/__init__.py similarity index 100% rename from neutron/newapi/__init__.py rename to neutron/pecan_wsgi/__init__.py diff --git a/neutron/newapi/app.py b/neutron/pecan_wsgi/app.py similarity index 92% rename from neutron/newapi/app.py rename to neutron/pecan_wsgi/app.py index 7471c9770..a369c834a 100644 --- a/neutron/newapi/app.py +++ b/neutron/pecan_wsgi/app.py @@ -19,8 +19,8 @@ from oslo_middleware import request_id import pecan from neutron.common import exceptions as n_exc -from neutron.newapi import hooks -from neutron.newapi import startup +from neutron.pecan_wsgi import hooks +from neutron.pecan_wsgi import startup CONF = cfg.CONF CONF.import_opt('bind_host', 'neutron.common.config') @@ -34,8 +34,8 @@ def setup_app(*args, **kwargs): 'host': CONF.bind_host }, 'app': { - 'root': 'neutron.newapi.controllers.root.RootController', - 'modules': ['neutron.newapi'], + 'root': 'neutron.pecan_wsgi.controllers.root.RootController', + 'modules': ['neutron.pecan_wsgi'], } #TODO(kevinbenton): error templates } diff --git a/neutron/newapi/controllers/__init__.py b/neutron/pecan_wsgi/controllers/__init__.py similarity index 100% rename from neutron/newapi/controllers/__init__.py rename to neutron/pecan_wsgi/controllers/__init__.py diff --git a/neutron/newapi/controllers/root.py b/neutron/pecan_wsgi/controllers/root.py similarity index 100% rename from neutron/newapi/controllers/root.py rename to neutron/pecan_wsgi/controllers/root.py diff --git a/neutron/newapi/hooks/__init__.py b/neutron/pecan_wsgi/hooks/__init__.py similarity index 71% rename from neutron/newapi/hooks/__init__.py rename to neutron/pecan_wsgi/hooks/__init__.py index ef5484249..cfe844c6e 100644 --- a/neutron/newapi/hooks/__init__.py +++ b/neutron/pecan_wsgi/hooks/__init__.py @@ -13,14 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.newapi.hooks import attribute_population -from neutron.newapi.hooks import context -from neutron.newapi.hooks import notifier -from neutron.newapi.hooks import ownership_validation -from neutron.newapi.hooks import policy_enforcement -from neutron.newapi.hooks import quota_enforcement -from neutron.newapi.hooks import resource_identifier -from neutron.newapi.hooks import translation +from neutron.pecan_wsgi.hooks import attribute_population +from neutron.pecan_wsgi.hooks import context +from neutron.pecan_wsgi.hooks import notifier +from neutron.pecan_wsgi.hooks import ownership_validation +from neutron.pecan_wsgi.hooks import policy_enforcement +from neutron.pecan_wsgi.hooks import quota_enforcement +from neutron.pecan_wsgi.hooks import resource_identifier +from neutron.pecan_wsgi.hooks import translation ExceptionTranslationHook = translation.ExceptionTranslationHook diff --git a/neutron/newapi/hooks/attribute_population.py b/neutron/pecan_wsgi/hooks/attribute_population.py similarity index 100% rename from neutron/newapi/hooks/attribute_population.py rename to neutron/pecan_wsgi/hooks/attribute_population.py diff --git a/neutron/newapi/hooks/context.py b/neutron/pecan_wsgi/hooks/context.py similarity index 100% rename from neutron/newapi/hooks/context.py rename to neutron/pecan_wsgi/hooks/context.py diff --git a/neutron/newapi/hooks/notifier.py b/neutron/pecan_wsgi/hooks/notifier.py similarity index 100% rename from neutron/newapi/hooks/notifier.py rename to neutron/pecan_wsgi/hooks/notifier.py diff --git a/neutron/newapi/hooks/ownership_validation.py b/neutron/pecan_wsgi/hooks/ownership_validation.py similarity index 100% rename from neutron/newapi/hooks/ownership_validation.py rename to neutron/pecan_wsgi/hooks/ownership_validation.py diff --git a/neutron/newapi/hooks/policy_enforcement.py b/neutron/pecan_wsgi/hooks/policy_enforcement.py similarity index 98% rename from neutron/newapi/hooks/policy_enforcement.py rename to neutron/pecan_wsgi/hooks/policy_enforcement.py index 4b0696c33..ac151c435 100644 --- a/neutron/newapi/hooks/policy_enforcement.py +++ b/neutron/pecan_wsgi/hooks/policy_enforcement.py @@ -23,7 +23,7 @@ from pecan import hooks import webob from neutron.common import constants as const -from neutron.newapi.hooks import attribute_population +from neutron.pecan_wsgi.hooks import attribute_population from neutron import policy diff --git a/neutron/newapi/hooks/quota_enforcement.py b/neutron/pecan_wsgi/hooks/quota_enforcement.py similarity index 96% rename from neutron/newapi/hooks/quota_enforcement.py rename to neutron/pecan_wsgi/hooks/quota_enforcement.py index 43e3c5f9c..1a9240329 100644 --- a/neutron/newapi/hooks/quota_enforcement.py +++ b/neutron/pecan_wsgi/hooks/quota_enforcement.py @@ -14,7 +14,7 @@ # under the License. from neutron.common import exceptions -from neutron.newapi.hooks import attribute_population +from neutron.pecan_wsgi.hooks import attribute_population from neutron import quota from oslo_log import log as logging diff --git a/neutron/newapi/hooks/resource_identifier.py b/neutron/pecan_wsgi/hooks/resource_identifier.py similarity index 100% rename from neutron/newapi/hooks/resource_identifier.py rename to neutron/pecan_wsgi/hooks/resource_identifier.py diff --git a/neutron/newapi/hooks/translation.py b/neutron/pecan_wsgi/hooks/translation.py similarity index 100% rename from neutron/newapi/hooks/translation.py rename to neutron/pecan_wsgi/hooks/translation.py diff --git a/neutron/newapi/startup.py b/neutron/pecan_wsgi/startup.py similarity index 100% rename from neutron/newapi/startup.py rename to neutron/pecan_wsgi/startup.py diff --git a/neutron/server/wsgi_pecan.py b/neutron/server/wsgi_pecan.py index a9d62b696..91677cc29 100755 --- a/neutron/server/wsgi_pecan.py +++ b/neutron/server/wsgi_pecan.py @@ -20,7 +20,7 @@ from six.moves import socketserver from neutron.common import rpc as n_rpc from neutron.i18n import _LI, _LW -from neutron.newapi import app as pecan_app +from neutron.pecan_wsgi import app as pecan_app from neutron import server LOG = log.getLogger(__name__) diff --git a/neutron/tests/functional/newapi/__init__.py b/neutron/tests/functional/pecan_wsgi/__init__.py similarity index 100% rename from neutron/tests/functional/newapi/__init__.py rename to neutron/tests/functional/pecan_wsgi/__init__.py diff --git a/neutron/tests/functional/newapi/config.py b/neutron/tests/functional/pecan_wsgi/config.py similarity index 88% rename from neutron/tests/functional/newapi/config.py rename to neutron/tests/functional/pecan_wsgi/config.py index 056df2ade..988961b09 100644 --- a/neutron/tests/functional/newapi/config.py +++ b/neutron/tests/functional/pecan_wsgi/config.py @@ -16,8 +16,8 @@ # use main app settings except for the port number so testing doesn't need to # listen on the main neutron port app = { - 'root': 'neutron.newapi.controllers.root.RootController', - 'modules': ['neutron.newapi'], + 'root': 'neutron.pecan_wsgi.controllers.root.RootController', + 'modules': ['neutron.pecan_wsgi'], 'errors': { 400: '/error', '__force_dict__': True diff --git a/neutron/tests/functional/newapi/test_functional.py b/neutron/tests/functional/pecan_wsgi/test_functional.py similarity index 95% rename from neutron/tests/functional/newapi/test_functional.py rename to neutron/tests/functional/pecan_wsgi/test_functional.py index a7cf4fa92..ee3d4ed4f 100644 --- a/neutron/tests/functional/newapi/test_functional.py +++ b/neutron/tests/functional/pecan_wsgi/test_functional.py @@ -28,7 +28,7 @@ from neutron.api.v2 import attributes from neutron.common import exceptions as n_exc from neutron import context from neutron import manager -from neutron.newapi.controllers import root as controllers +from neutron.pecan_wsgi.controllers import root as controllers from neutron.tests.unit import testlib_api @@ -154,15 +154,17 @@ class TestExceptionTranslationHook(PecanFunctionalTest): # this endpoint raises a Neutron notfound exception. make sure it gets # translated into a 404 error with mock.patch( - 'neutron.newapi.controllers.root.CollectionsController.get', - side_effect=n_exc.NotFound()): + 'neutron.pecan_wsgi.controllers.root.CollectionsController.get', + side_effect=n_exc.NotFound() + ): response = self.app.get('/v2.0/ports.json', expect_errors=True) self.assertEqual(response.status_int, 404) def test_unexpected_exception(self): with mock.patch( - 'neutron.newapi.controllers.root.CollectionsController.get', - side_effect=ValueError('secretpassword')): + 'neutron.pecan_wsgi.controllers.root.CollectionsController.get', + side_effect=ValueError('secretpassword') + ): response = self.app.get('/v2.0/ports.json', expect_errors=True) self.assertNotIn(response.body, 'secretpassword') self.assertEqual(response.status_int, 500) @@ -184,7 +186,7 @@ class TestRequestPopulatingHooks(PecanFunctionalTest): 'plugin': request.plugin } mock.patch( - 'neutron.newapi.controllers.root.CollectionsController.get', + 'neutron.pecan_wsgi.controllers.root.CollectionsController.get', side_effect=capture_request_details ).start()