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:
parent
6feacc0c6d
commit
7e8ae4a416
@ -65,7 +65,7 @@ class QuantumManager(object):
|
|||||||
else:
|
else:
|
||||||
LOG.debug("Successfully imported Quantum plug-in." \
|
LOG.debug("Successfully imported Quantum plug-in." \
|
||||||
"All compatibility tests passed")
|
"All compatibility tests passed")
|
||||||
self.plugin = plugin_klass(options)
|
self.plugin = plugin_klass()
|
||||||
|
|
||||||
def get_plugin(self):
|
def get_plugin(self):
|
||||||
return self.plugin
|
return self.plugin
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
[PLUGIN]
|
[PLUGIN]
|
||||||
# Quantum plugin provider module
|
# Quantum plugin provider module
|
||||||
provider = quantum.plugins.SamplePlugin.FakePlugin
|
#provider = quantum.plugins.SamplePlugin.FakePlugin
|
||||||
|
provider = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPlugin
|
||||||
|
@ -233,13 +233,8 @@ class FakePlugin(object):
|
|||||||
client/cli/api development
|
client/cli/api development
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, options):
|
def __init__(self):
|
||||||
# use supplied options for configuring db
|
db.configure_db({'sql_connection':'sqlite:///:memory:'})
|
||||||
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)
|
|
||||||
FakePlugin._net_counter = 0
|
FakePlugin._net_counter = 0
|
||||||
|
|
||||||
def _get_network(self, tenant_id, network_id):
|
def _get_network(self, tenant_id, network_id):
|
||||||
|
@ -30,14 +30,6 @@ class QuantumPluginBase(object):
|
|||||||
|
|
||||||
__metaclass__ = ABCMeta
|
__metaclass__ = ABCMeta
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def __init__(self, options):
|
|
||||||
"""
|
|
||||||
Initializes the Quantum plugin using provided options.
|
|
||||||
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_all_networks(self, tenant_id):
|
def get_all_networks(self, tenant_id):
|
||||||
"""
|
"""
|
||||||
|
@ -615,10 +615,8 @@ class APITest(unittest.TestCase):
|
|||||||
"format:%s - END", format)
|
"format:%s - END", format)
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.db_file = ':memory:'
|
|
||||||
options = {}
|
options = {}
|
||||||
options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin'
|
options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin'
|
||||||
options['sql_connection'] = 'sqlite:///%s' % self.db_file
|
|
||||||
self.api = server.APIRouterV01(options)
|
self.api = server.APIRouterV01(options)
|
||||||
self.tenant_id = "test_tenant"
|
self.tenant_id = "test_tenant"
|
||||||
self.network_name = "test_network"
|
self.network_name = "test_network"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user