~asomya/+junk/quantum-dev

« back to all changes in this revision

Viewing changes to quantum/manager.py

  • Committer: Somik Behera
  • Date: 2011-05-20 00:21:48 UTC
  • Revision ID: somik@nicira.com-20110520002148-gvd8cy3axjr9ybhf
Move plugin configuration to plugins.ini - a config file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
The caller should make sure that QuantumManager is a singleton.
25
25
"""
26
26
 
27
 
import utils
 
27
from common import utils
28
28
from quantum_plugin_base import QuantumPluginBase
29
29
 
30
 
CONFIG_FILE = "quantum_plugin.conf"
 
30
CONFIG_FILE = "plugins.ini"
31
31
 
32
32
class QuantumManager(object):
33
33
    
34
34
   def __init__(self,config=CONFIG_FILE):
35
35
        self.configuration_file = CONFIG_FILE
36
 
        #TODO(somik): plugin location should be grabbed from a
37
 
        # configuration file as opposed to hard-coding the location
38
 
        #
39
 
        #plugin_location = get_plugin_location(configuration_file)
40
 
        plugin_location = "plugins.SamplePlugin.DummyDataPlugin"
 
36
        plugin_location = utils.getPluginFromConfig(CONFIG_FILE)
41
37
        plugin_klass = utils.import_class(plugin_location)
42
38
        if not issubclass(plugin_klass, QuantumPluginBase):
43
39
            raise Exception("Configured Quantum plug-in didn't pass compatibility test")