can now import and use sfa.server.sfaapi withough having to worry about registry...
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Mon, 9 Jan 2012 17:22:53 +0000 (12:22 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Mon, 9 Jan 2012 17:22:53 +0000 (12:22 -0500)
sfa/generic/pl.py
sfa/server/sfaapi.py

index 2c03619..92b7266 100644 (file)
@@ -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
index b783369..3bd8968 100644 (file)
@@ -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: