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
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')
'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
}
# 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
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
# 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
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__)
# 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
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
# 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)
'plugin': request.plugin
}
mock.patch(
- 'neutron.newapi.controllers.root.CollectionsController.get',
+ 'neutron.pecan_wsgi.controllers.root.CollectionsController.get',
side_effect=capture_request_details
).start()