Drop the web_framework option

This option is no longer needed as we have switched to pecan
and will be deleting the legacy API layer.

Implements: blueprint wsgi-pecan-switch
Change-Id: Ib153d75bb10375e048a8417139873bdf9dca8769
This commit is contained in:
Kevin Benton 2017-07-20 14:08:47 -07:00
parent 863fb129f9
commit e2ea0b4652
8 changed files with 10 additions and 34 deletions

View File

@ -67,9 +67,8 @@ class APIRouter(base_wsgi.Router):
@classmethod @classmethod
def factory(cls, global_config, **local_config): def factory(cls, global_config, **local_config):
if cfg.CONF.web_framework == 'pecan': # TODO(kevinbenton): dump this whole class
return pecan_app.v2_factory(global_config, **local_config) return pecan_app.v2_factory(global_config, **local_config)
return cls(**local_config)
def __init__(self, **local_config): def __init__(self, **local_config):
mapper = routes_mapper.Mapper() mapper = routes_mapper.Mapper()

View File

@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_config import cfg
import oslo_i18n import oslo_i18n
import webob.dec import webob.dec
@ -27,9 +26,8 @@ class Versions(object):
@classmethod @classmethod
def factory(cls, global_config, **local_config): def factory(cls, global_config, **local_config):
if cfg.CONF.web_framework == 'pecan': # TODO(kevinbenton): get rid of whole class
return pecan_app.versions_factory(global_config, **local_config) return pecan_app.versions_factory(global_config, **local_config)
return cls(app=None)
@webob.dec.wsgify(RequestClass=wsgi.Request) @webob.dec.wsgify(RequestClass=wsgi.Request)
def __call__(self, req): def __call__(self, req):

View File

@ -117,12 +117,6 @@ core_opts = [
cfg.BoolOpt('vlan_transparent', default=False, cfg.BoolOpt('vlan_transparent', default=False,
help=_('If True, then allow plugins that support it to ' help=_('If True, then allow plugins that support it to '
'create VLAN transparent networks.')), 'create VLAN transparent networks.')),
cfg.StrOpt('web_framework', default='pecan',
deprecated_for_removal=True,
choices=('legacy', 'pecan'),
help=_("This will choose the web framework in which to run "
"the Neutron API server. 'pecan' is a new "
"rewrite of the API routing components.")),
cfg.IntOpt('global_physnet_mtu', default=constants.DEFAULT_NETWORK_MTU, cfg.IntOpt('global_physnet_mtu', default=constants.DEFAULT_NETWORK_MTU,
deprecated_name='segment_mtu', deprecated_group='ml2', deprecated_name='segment_mtu', deprecated_group='ml2',
help=_('MTU of the underlying physical network. Neutron uses ' help=_('MTU of the underlying physical network. Neutron uses '

View File

@ -1,4 +0,0 @@
[[post-config|/etc/neutron/neutron.conf]]
[DEFAULT]
web_framework=pecan

View File

@ -85,7 +85,6 @@ class PecanFunctionalTest(testlib_api.SqlTestCase):
self.app = create_test_app() self.app = create_test_app()
def set_config_overrides(self): def set_config_overrides(self):
cfg.CONF.set_override('web_framework', 'pecan')
cfg.CONF.set_override('auth_strategy', 'noauth') cfg.CONF.set_override('auth_strategy', 'noauth')
def do_request(self, url, tenant_id=None, admin=False, def do_request(self, url, tenant_id=None, admin=False,

View File

@ -11,7 +11,6 @@
# under the License. # under the License.
import mock import mock
from oslo_config import cfg
from neutron.api import versions from neutron.api import versions
from neutron.tests import base from neutron.tests import base
@ -21,14 +20,7 @@ from neutron.tests import base
@mock.patch('neutron.pecan_wsgi.app.versions_factory') @mock.patch('neutron.pecan_wsgi.app.versions_factory')
class TestVersions(base.BaseTestCase): class TestVersions(base.BaseTestCase):
def test_legacy_factory(self, pecan_mock, legacy_mock):
cfg.CONF.set_override('web_framework', 'legacy')
versions.Versions.factory({})
pecan_mock.assert_not_called()
legacy_mock.assert_called_once_with(app=None)
def test_pecan_factory(self, pecan_mock, legacy_mock): def test_pecan_factory(self, pecan_mock, legacy_mock):
cfg.CONF.set_override('web_framework', 'pecan')
versions.Versions.factory({}) versions.Versions.factory({})
pecan_mock.assert_called_once_with({}) pecan_mock.assert_called_once_with({})
legacy_mock.assert_not_called() legacy_mock.assert_not_called()

View File

@ -11,7 +11,6 @@
# under the License. # under the License.
import mock import mock
from oslo_config import cfg
from neutron.api.v2 import router from neutron.api.v2 import router
from neutron.tests import base from neutron.tests import base
@ -21,14 +20,7 @@ from neutron.tests import base
@mock.patch('neutron.pecan_wsgi.app.v2_factory') @mock.patch('neutron.pecan_wsgi.app.v2_factory')
class TestRouter(base.BaseTestCase): class TestRouter(base.BaseTestCase):
def test_legacy_factory(self, pecan_mock, legacy_mock):
cfg.CONF.set_override('web_framework', 'legacy')
router.APIRouter.factory({})
pecan_mock.assert_not_called()
legacy_mock.assert_called_once_with()
def test_pecan_factory(self, pecan_mock, legacy_mock): def test_pecan_factory(self, pecan_mock, legacy_mock):
cfg.CONF.set_override('web_framework', 'pecan')
router.APIRouter.factory({}) router.APIRouter.factory({})
pecan_mock.assert_called_once_with({}) pecan_mock.assert_called_once_with({})
legacy_mock.assert_not_called() legacy_mock.assert_not_called()

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The web_framework option has been removed. This should have no impact on
operators/users since it was just an option used for development of the
new web framework.