Merging lp:~salvatore-orlando/quantum/bug834449

Fix for Bug #834449
This commit is contained in:
Salvatore Orlando 2011-08-30 17:30:15 +01:00
commit b3263d371b
8 changed files with 9 additions and 11 deletions

View File

@ -29,4 +29,4 @@ paste.filter_factory = quantum.common.extensions:plugin_aware_extension_middlewa
paste.app_factory = quantum.api.versions:Versions.factory
[app:quantumapiapp]
paste.app_factory = quantum.api:APIRouterV01.factory
paste.app_factory = quantum.api:APIRouterV1.factory

View File

@ -37,7 +37,7 @@ LOG = logging.getLogger('quantum.api')
FLAGS = flags.FLAGS
class APIRouterV01(wsgi.Router):
class APIRouterV1(wsgi.Router):
"""
Routes requests on the Quantum API to the appropriate controller
"""
@ -45,7 +45,7 @@ class APIRouterV01(wsgi.Router):
def __init__(self, options=None):
mapper = routes.Mapper()
self._setup_routes(mapper, options)
super(APIRouterV01, self).__init__(mapper)
super(APIRouterV1, self).__init__(mapper)
def _setup_routes(self, mapper, options):
# Loads the quantum plugin
@ -64,9 +64,7 @@ class APIRouterV01(wsgi.Router):
parent_resource=dict(member_name='network',
collection_name=uri_prefix +\
'networks'))
attachments_ctrl = attachments.Controller(plugin)
mapper.connect("get_resource",
uri_prefix + 'networks/{network_id}/' \
'ports/{id}/attachment{.format}',

View File

@ -338,7 +338,7 @@ def plugin_aware_extension_middleware_factory(global_config, **local_config):
def _factory(app):
extensions_path = global_config.get('api_extensions_path', '')
ext_mgr = PluginAwareExtensionManager(extensions_path,
QuantumManager().get_plugin())
QuantumManager.get_plugin())
return ExtensionMiddleware(app, global_config, ext_mgr=ext_mgr)
return _factory

View File

@ -26,7 +26,7 @@ The caller should make sure that QuantumManager is a singleton.
import gettext
import logging
import os
import logging
gettext.install('quantum', unicode=1)
from common import utils

View File

@ -87,7 +87,7 @@ class PortprofileExtensionTest(unittest.TestCase):
options = {}
options['plugin_provider'] = 'quantum.plugins.cisco.l2network_plugin'\
'.L2Network'
self.api = server.APIRouterV01(options)
self.api = server.APIRouterV1(options)
self._l2network_plugin = l2network_plugin.L2Network()
def test_list_portprofile(self):

View File

@ -42,7 +42,7 @@ class FakeHTTPConnection:
self._req = None
options = \
dict(plugin_provider='quantum.plugins.SamplePlugin.FakePlugin')
self._api = server.APIRouterV01(options)
self._api = server.APIRouterV1(options)
def request(self, method, action, body, headers):
# TODO: remove version prefix from action!

View File

@ -785,7 +785,7 @@ class APITest(unittest.TestCase):
def setUp(self):
options = {}
options['plugin_provider'] = test_config['plugin_name']
self.api = server.APIRouterV01(options)
self.api = server.APIRouterV1(options)
self.tenant_id = "test_tenant"
self.network_name = "test_network"
self._net_serializer = \

View File

@ -42,7 +42,7 @@ class CLITest(unittest.TestCase):
"""Prepare the test environment"""
options = {}
options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin'
self.api = server.APIRouterV01(options)
self.api = server.APIRouterV1(options)
self.tenant_id = "test_tenant"
self.network_name_1 = "test_network_1"