From: Tony Mack Date: Mon, 9 Jan 2012 17:22:53 +0000 (-0500) Subject: can now import and use sfa.server.sfaapi withough having to worry about registry... X-Git-Tag: before-alchemy~2^2~11 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=efd5d7736f4d07356ff2ebb53c1123335007fa8e;p=sfa.git can now import and use sfa.server.sfaapi withough having to worry about registry dependencies --- diff --git a/sfa/generic/pl.py b/sfa/generic/pl.py index 2c036199..92b7266f 100644 --- a/sfa/generic/pl.py +++ b/sfa/generic/pl.py @@ -1,27 +1,27 @@ from sfa.generic import Generic -import sfa.server.sfaapi -import sfa.plc.pldriver -import sfa.managers.registry_manager -import sfa.managers.slice_manager -import sfa.managers.aggregate_manager class pl (Generic): # use the standard api class def api_class (self): + import sfa.server.sfaapi return sfa.server.sfaapi.SfaApi # the manager classes for the server-side services def registry_manager_class (self) : + import sfa.managers.registry_manager return sfa.managers.registry_manager.RegistryManager def slicemgr_manager_class (self) : + import sfa.managers.slice_manager return sfa.managers.slice_manager.SliceManager def aggregate_manager_class (self) : + import sfa.managers.aggregate_manager return sfa.managers.aggregate_manager.AggregateManager # driver class for server-side services, talk to the whole testbed def driver_class (self): + import sfa.plc.pldriver return sfa.plc.pldriver.PlDriver # for the component mode, to be run on board planetlab nodes diff --git a/sfa/server/sfaapi.py b/sfa/server/sfaapi.py index b783369a..3bd89687 100644 --- a/sfa/server/sfaapi.py +++ b/sfa/server/sfaapi.py @@ -15,8 +15,6 @@ from sfa.server.xmlrpcapi import XmlrpcApi from sfa.client.return_value import ReturnValue -# thgen xxx fixme this is wrong all right, but temporary, will use generic -from sfa.storage.table import SfaTable #################### class SfaApi (XmlrpcApi): @@ -163,7 +161,8 @@ class SfaApi (XmlrpcApi): auth_hrn = hrn auth_info = self.auth.get_auth_info(auth_hrn) # xxx thgen fixme - use SfaTable hardwired for now - #table = self.SfaTable() + # thgen xxx fixme this is wrong all right, but temporary, will use generic + from sfa.storage.table import SfaTable table = SfaTable() records = table.findObjects({'hrn': hrn, 'type': 'authority+sa'}) if not records: