From 6b4012de9fef7b1f6695bca26f67c31a5f69617d Mon Sep 17 00:00:00 2001 From: Yun Mao Date: Thu, 24 May 2012 15:42:46 -0400 Subject: removed a dead db function register_models() The actual models are created by the migration modules. register_models() are no longer used and raises some confusions. Change-Id: Id418917f3bbcf9a951b89bec01499a53cc92f57b --- nova/db/sqlalchemy/models.py | 48 -------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index 78fcaa7e5..fa10356a6 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -1049,51 +1049,3 @@ class InstanceFault(BASE, NovaBase): code = Column(Integer(), nullable=False) message = Column(String(255)) details = Column(Text) - - -def register_models(): - """Register Models and create metadata. - - Called from nova.db.sqlalchemy.__init__ as part of loading the driver, - it will never need to be called explicitly elsewhere unless the - connection is lost and needs to be reestablished. - """ - from sqlalchemy import create_engine - models = (AgentBuild, - Aggregate, - AggregateHost, - AggregateMetadata, - AuthToken, - Certificate, - Cell, - Console, - ConsolePool, - FixedIp, - FloatingIp, - Instance, - InstanceFault, - InstanceMetadata, - InstanceTypeExtraSpecs, - InstanceTypes, - IscsiTarget, - Migration, - Network, - Project, - SecurityGroup, - SecurityGroupIngressRule, - SecurityGroupInstanceAssociation, - Service, - SMBackendConf, - SMFlavors, - SMVolume, - User, - Volume, - VolumeMetadata, - VolumeTypeExtraSpecs, - VolumeTypes, - VolumeIdMapping, - SnapshotIdMapping, - ) - engine = create_engine(FLAGS.sql_connection, echo=False) - for model in models: - model.metadata.create_all(engine) -- cgit