Merge "Drop the web_framework option"

This commit is contained in:
Jenkins 2017-09-14 15:13:00 +00:00 committed by Gerrit Code Review
commit b59d008b1e
8 changed files with 10 additions and 34 deletions

View File

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

View File

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

View File

@ -117,12 +117,6 @@ core_opts = [
cfg.BoolOpt('vlan_transparent', default=False,
help=_('If True, then allow plugins that support it to '
'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,
deprecated_name='segment_mtu', deprecated_group='ml2',
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()
def set_config_overrides(self):
cfg.CONF.set_override('web_framework', 'pecan')
cfg.CONF.set_override('auth_strategy', 'noauth')
def do_request(self, url, tenant_id=None, admin=False,

View File

@ -11,7 +11,6 @@
# under the License.
import mock
from oslo_config import cfg
from neutron.api import versions
from neutron.tests import base
@ -21,14 +20,7 @@ from neutron.tests import base
@mock.patch('neutron.pecan_wsgi.app.versions_factory')
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):
cfg.CONF.set_override('web_framework', 'pecan')
versions.Versions.factory({})
pecan_mock.assert_called_once_with({})
legacy_mock.assert_not_called()

View File

@ -11,7 +11,6 @@
# under the License.
import mock
from oslo_config import cfg
from neutron.api.v2 import router
from neutron.tests import base
@ -21,14 +20,7 @@ from neutron.tests import base
@mock.patch('neutron.pecan_wsgi.app.v2_factory')
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):
cfg.CONF.set_override('web_framework', 'pecan')
router.APIRouter.factory({})
pecan_mock.assert_called_once_with({})
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.