should be able to upgrade from any version
[sfa.git] / sfa / server / registry.py
index 0919a1b..13a75fc 100644 (file)
@@ -20,10 +20,11 @@ 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.model import init_tables
-        init_tables(dbsession)
+        sfa_config=Config()
+        if Config().SFA_REGISTRY_ENABLED: 
+            from sfa.storage.alchemy import engine
+            from sfa.storage.dbschema import DBSchema
+            DBSchema().init_or_upgrade()
 
 #
 # Registries is a dictionary of registry connections keyed on the registry hrn