commit
b3263d371b
@ -29,4 +29,4 @@ paste.filter_factory = quantum.common.extensions:plugin_aware_extension_middlewa
|
|||||||
paste.app_factory = quantum.api.versions:Versions.factory
|
paste.app_factory = quantum.api.versions:Versions.factory
|
||||||
|
|
||||||
[app:quantumapiapp]
|
[app:quantumapiapp]
|
||||||
paste.app_factory = quantum.api:APIRouterV01.factory
|
paste.app_factory = quantum.api:APIRouterV1.factory
|
||||||
|
@ -37,7 +37,7 @@ LOG = logging.getLogger('quantum.api')
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
|
||||||
class APIRouterV01(wsgi.Router):
|
class APIRouterV1(wsgi.Router):
|
||||||
"""
|
"""
|
||||||
Routes requests on the Quantum API to the appropriate controller
|
Routes requests on the Quantum API to the appropriate controller
|
||||||
"""
|
"""
|
||||||
@ -45,7 +45,7 @@ class APIRouterV01(wsgi.Router):
|
|||||||
def __init__(self, options=None):
|
def __init__(self, options=None):
|
||||||
mapper = routes.Mapper()
|
mapper = routes.Mapper()
|
||||||
self._setup_routes(mapper, options)
|
self._setup_routes(mapper, options)
|
||||||
super(APIRouterV01, self).__init__(mapper)
|
super(APIRouterV1, self).__init__(mapper)
|
||||||
|
|
||||||
def _setup_routes(self, mapper, options):
|
def _setup_routes(self, mapper, options):
|
||||||
# Loads the quantum plugin
|
# Loads the quantum plugin
|
||||||
@ -64,9 +64,7 @@ class APIRouterV01(wsgi.Router):
|
|||||||
parent_resource=dict(member_name='network',
|
parent_resource=dict(member_name='network',
|
||||||
collection_name=uri_prefix +\
|
collection_name=uri_prefix +\
|
||||||
'networks'))
|
'networks'))
|
||||||
|
|
||||||
attachments_ctrl = attachments.Controller(plugin)
|
attachments_ctrl = attachments.Controller(plugin)
|
||||||
|
|
||||||
mapper.connect("get_resource",
|
mapper.connect("get_resource",
|
||||||
uri_prefix + 'networks/{network_id}/' \
|
uri_prefix + 'networks/{network_id}/' \
|
||||||
'ports/{id}/attachment{.format}',
|
'ports/{id}/attachment{.format}',
|
||||||
|
@ -338,7 +338,7 @@ def plugin_aware_extension_middleware_factory(global_config, **local_config):
|
|||||||
def _factory(app):
|
def _factory(app):
|
||||||
extensions_path = global_config.get('api_extensions_path', '')
|
extensions_path = global_config.get('api_extensions_path', '')
|
||||||
ext_mgr = PluginAwareExtensionManager(extensions_path,
|
ext_mgr = PluginAwareExtensionManager(extensions_path,
|
||||||
QuantumManager().get_plugin())
|
QuantumManager.get_plugin())
|
||||||
return ExtensionMiddleware(app, global_config, ext_mgr=ext_mgr)
|
return ExtensionMiddleware(app, global_config, ext_mgr=ext_mgr)
|
||||||
return _factory
|
return _factory
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ The caller should make sure that QuantumManager is a singleton.
|
|||||||
import gettext
|
import gettext
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import logging
|
|
||||||
gettext.install('quantum', unicode=1)
|
gettext.install('quantum', unicode=1)
|
||||||
|
|
||||||
from common import utils
|
from common import utils
|
||||||
|
@ -87,7 +87,7 @@ class PortprofileExtensionTest(unittest.TestCase):
|
|||||||
options = {}
|
options = {}
|
||||||
options['plugin_provider'] = 'quantum.plugins.cisco.l2network_plugin'\
|
options['plugin_provider'] = 'quantum.plugins.cisco.l2network_plugin'\
|
||||||
'.L2Network'
|
'.L2Network'
|
||||||
self.api = server.APIRouterV01(options)
|
self.api = server.APIRouterV1(options)
|
||||||
self._l2network_plugin = l2network_plugin.L2Network()
|
self._l2network_plugin = l2network_plugin.L2Network()
|
||||||
|
|
||||||
def test_list_portprofile(self):
|
def test_list_portprofile(self):
|
||||||
|
@ -42,7 +42,7 @@ class FakeHTTPConnection:
|
|||||||
self._req = None
|
self._req = None
|
||||||
options = \
|
options = \
|
||||||
dict(plugin_provider='quantum.plugins.SamplePlugin.FakePlugin')
|
dict(plugin_provider='quantum.plugins.SamplePlugin.FakePlugin')
|
||||||
self._api = server.APIRouterV01(options)
|
self._api = server.APIRouterV1(options)
|
||||||
|
|
||||||
def request(self, method, action, body, headers):
|
def request(self, method, action, body, headers):
|
||||||
# TODO: remove version prefix from action!
|
# TODO: remove version prefix from action!
|
||||||
|
@ -785,7 +785,7 @@ class APITest(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
options = {}
|
options = {}
|
||||||
options['plugin_provider'] = test_config['plugin_name']
|
options['plugin_provider'] = test_config['plugin_name']
|
||||||
self.api = server.APIRouterV01(options)
|
self.api = server.APIRouterV1(options)
|
||||||
self.tenant_id = "test_tenant"
|
self.tenant_id = "test_tenant"
|
||||||
self.network_name = "test_network"
|
self.network_name = "test_network"
|
||||||
self._net_serializer = \
|
self._net_serializer = \
|
||||||
|
@ -42,7 +42,7 @@ class CLITest(unittest.TestCase):
|
|||||||
"""Prepare the test environment"""
|
"""Prepare the test environment"""
|
||||||
options = {}
|
options = {}
|
||||||
options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin'
|
options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin'
|
||||||
self.api = server.APIRouterV01(options)
|
self.api = server.APIRouterV1(options)
|
||||||
|
|
||||||
self.tenant_id = "test_tenant"
|
self.tenant_id = "test_tenant"
|
||||||
self.network_name_1 = "test_network_1"
|
self.network_name_1 = "test_network_1"
|
||||||
|
Loading…
Reference in New Issue
Block a user