networks api with final URL structure.

No serialization yet
This commit is contained in:
salvatore 2011-05-27 00:52:11 +01:00
parent 5022c07f6b
commit 55599d7184
5 changed files with 13 additions and 6 deletions

View File

@ -56,6 +56,7 @@ if __name__ == '__main__':
try: try:
print "HERE-1" print "HERE-1"
print sys.path
service = service.serve_wsgi(service.QuantumApiService, service = service.serve_wsgi(service.QuantumApiService,
options=options, options=options,
args=args) args=args)

View File

@ -29,8 +29,8 @@ import socket
import sys import sys
import ConfigParser import ConfigParser
from quantum.common import exceptions as exception import exceptions as exception
from quantum.common import flags import flags
from exceptions import ProcessExecutionError from exceptions import ProcessExecutionError
@ -76,7 +76,7 @@ def import_class(import_str):
#mod_str = os.path.join(FLAGS.state_path, mod_str) #mod_str = os.path.join(FLAGS.state_path, mod_str)
print "MODULE PATH:%s" %mod_str print "MODULE PATH:%s" %mod_str
print "CUR DIR:%s" %os.getcwd() print "CUR DIR:%s" %os.getcwd()
__import__(mod_str) __import__(mod_str, level=2)
print "IO SONO QUI" print "IO SONO QUI"
return getattr(sys.modules[mod_str], class_str) return getattr(sys.modules[mod_str], class_str)
except (ImportError, ValueError, AttributeError) as e: except (ImportError, ValueError, AttributeError) as e:
@ -194,6 +194,7 @@ def parse_isotime(timestr):
def getPluginFromConfig(file="config.ini"): def getPluginFromConfig(file="config.ini"):
print "FILE:%s" %os.path.join(FLAGS.state_path, file) print "FILE:%s" %os.path.join(FLAGS.state_path, file)
print "Globals:%s" %globals()
Config = ConfigParser.ConfigParser() Config = ConfigParser.ConfigParser()
Config.read(os.path.join(FLAGS.state_path, file)) Config.read(os.path.join(FLAGS.state_path, file))
return Config.get("PLUGIN", "provider") return Config.get("PLUGIN", "provider")

View File

@ -23,7 +23,9 @@ plugin that concretely implement quantum_plugin_base class
The caller should make sure that QuantumManager is a singleton. The caller should make sure that QuantumManager is a singleton.
""" """
import gettext
gettext.install('quantum', unicode=1)
from common import utils from common import utils
from quantum_plugin_base import QuantumPluginBase from quantum_plugin_base import QuantumPluginBase
@ -45,6 +47,9 @@ class QuantumManager(object):
def get_manager(self): def get_manager(self):
return self.plugin return self.plugin
# TODO(somik): rmove the main class # TODO(somik): rmove the main class
# Added for temporary testing purposes # Added for temporary testing purposes
def main(): def main():

View File

@ -1,3 +1,3 @@
[PLUGIN] [PLUGIN]
# Quantum plugin provider module # Quantum plugin provider module
provider = plugins.SamplePlugin.DummyDataPlugin provider = quantum.plugins.SamplePlugin.DummyDataPlugin

View File

@ -35,7 +35,7 @@ import sys
import time import time
import types import types
from quantum.common import exceptions as exception from common import exceptions as exception
def import_class(import_str): def import_class(import_str):