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
This commit is contained in:
Kevin Benton 2015-08-31 10:22:50 -07:00 committed by Kevin Benton
parent ae319ee359
commit be9bff66be
19 changed files with 26 additions and 24 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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