Restoring quantum_plugin_base to previous state.

Will discuss in the future whether allow API layer to pass options to plugins upon initialization.
This commit is contained in:
Salvatore Orlando 2011-07-21 16:34:58 +01:00
parent 6feacc0c6d
commit 7e8ae4a416
5 changed files with 5 additions and 19 deletions

View File

@ -65,7 +65,7 @@ class QuantumManager(object):
else:
LOG.debug("Successfully imported Quantum plug-in." \
"All compatibility tests passed")
self.plugin = plugin_klass(options)
self.plugin = plugin_klass()
def get_plugin(self):
return self.plugin

View File

@ -1,3 +1,4 @@
[PLUGIN]
# Quantum plugin provider module
provider = quantum.plugins.SamplePlugin.FakePlugin
#provider = quantum.plugins.SamplePlugin.FakePlugin
provider = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPlugin

View File

@ -233,13 +233,8 @@ class FakePlugin(object):
client/cli/api development
"""
def __init__(self, options):
# use supplied options for configuring db
if not options:
options = {"sql_connection": "sqlite:///fake_plugin.sqllite"}
elif not 'sql_connection' in options:
options['sql_connection'] = "sqlite:///fake_plugin.sqllite"
db.configure_db(options)
def __init__(self):
db.configure_db({'sql_connection':'sqlite:///:memory:'})
FakePlugin._net_counter = 0
def _get_network(self, tenant_id, network_id):

View File

@ -30,14 +30,6 @@ class QuantumPluginBase(object):
__metaclass__ = ABCMeta
@abstractmethod
def __init__(self, options):
"""
Initializes the Quantum plugin using provided options.
"""
pass
@abstractmethod
def get_all_networks(self, tenant_id):
"""

View File

@ -615,10 +615,8 @@ class APITest(unittest.TestCase):
"format:%s - END", format)
def setUp(self):
self.db_file = ':memory:'
options = {}
options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin'
options['sql_connection'] = 'sqlite:///%s' % self.db_file
self.api = server.APIRouterV01(options)
self.tenant_id = "test_tenant"
self.network_name = "test_network"