--- /dev/null
+# This setting is designed for running a registry-only SFA instance
+
+from sfa.generic import Generic
+
+class void (Generic):
+
+ # the importer class
+ # when set to None, the importer only performs the basic stuff
+ # xxx this convention probably is confusing, since None suggests that
+ # *nothing* should be done..
+ # xxx need to refactor the importers anyway
+ def importer_class (self):
+ return None
+
+ # 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
+ # most likely you'll want to turn OFF the aggregate in sfa-config-tty
+ # SFA_AGGREGATE_ENABLED=false
+ 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.managers.driver
+ return sfa.managers.driver.Driver
+
from sfa.util.config import Config
from sfa.util.sfalogging import _SfaLogger
from sfa.trust.hierarchy import Hierarchy
-from sfa.trust.trustedroots import TrustedRoots
+#from sfa.trust.trustedroots import TrustedRoots
from sfa.trust.gid import create_uuid
from sfa.storage.alchemy import dbsession
from sfa.storage.model import RegRecord, RegAuthority, RegUser
class Importer:
- def __init__(self):
+
+ def __init__(self,auth_hierarchy=None,logger=None):
self.config = Config()
- self.logger = _SfaLogger(logfile='/var/log/sfa_import.log', loggername='importlog')
- self.logger.setLevelFromOptVerbose(self.config.SFA_API_LOGLEVEL)
- self.auth_hierarchy = Hierarchy ()
- self.TrustedRoots = TrustedRoots(self.config.get_trustedroots_dir())
+ if auth_hierarchy is not None:
+ self.auth_hierarchy=auth_hierarchy
+ else:
+ self.auth_hierarchy = Hierarchy ()
+ if logger is not None:
+ self.logger=logger
+ else:
+ self.logger = _SfaLogger(logfile='/var/log/sfa_import.log', loggername='importlog')
+ self.logger.setLevelFromOptVerbose(self.config.SFA_API_LOGLEVEL)
+# self.TrustedRoots = TrustedRoots(self.config.get_trustedroots_dir())
# check before creating a RegRecord entry as we run this over and over
def record_exists (self, type, hrn):
if testbed_importer:
testbed_importer.add_options(options)
testbed_importer.run (options)
-
-