add support for migrations with sqlalchemy-migrate
[sfa.git] / sfa / server / registry.py
index b55f9ac..5bc7af5 100644 (file)
@@ -2,13 +2,13 @@
 # Registry is a SfaServer that implements the Registry interface
 #
 from sfa.server.sfaserver import SfaServer
-from sfa.util.faults import *
-from sfa.util.xrn import hrn_to_urn
 from sfa.server.interface import Interfaces, Interface
 from sfa.util.config import Config 
 
-##
+#
 # Registry is a SfaServer that serves registry and slice operations at PLC.
+# this truly is a server-side object
+#
 class Registry(SfaServer):
     ##
     # Create a new registry object.
@@ -20,11 +20,15 @@ class Registry(SfaServer):
     
     def __init__(self, ip, port, key_file, cert_file):
         SfaServer.__init__(self, ip, port, key_file, cert_file,'registry')
+        # initialize db schema
+        from sfa.storage.alchemy import dbsession
+        from sfa.storage.persistentobjs import init_tables
+        init_tables(dbsession)
 
-##
-# Registries is a dictionary of registry connections keyed on the registry
-# hrn
-
+#
+# Registries is a dictionary of registry connections keyed on the registry hrn
+# as such it's more of a client-side thing for registry servers to reach their peers
+#
 class Registries(Interfaces):
     
     default_dict = {'registries': {'registry': [Interfaces.default_fields]}}