Merge "sqlalchemy migration not to import model"
This commit is contained in:
commit
d971917560
|
@ -15,10 +15,10 @@ import copy
|
|||
|
||||
from migrate.versioning import util as migrate_util
|
||||
import six
|
||||
import sqlalchemy
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from heat.common.i18n import _
|
||||
from heat.db.sqlalchemy import models
|
||||
from heat.engine.hot.parameters import HOTParamSchema
|
||||
|
||||
|
||||
|
@ -26,7 +26,10 @@ def upgrade(migrate_engine):
|
|||
Session = sessionmaker(bind=migrate_engine)
|
||||
session = Session()
|
||||
|
||||
raw_templates = session.query(models.RawTemplate).all()
|
||||
meta = sqlalchemy.MetaData(bind=migrate_engine)
|
||||
|
||||
templ_table = sqlalchemy.Table('raw_template', meta, autoload=True)
|
||||
raw_templates = templ_table.select().execute()
|
||||
|
||||
for raw_template in raw_templates:
|
||||
if ('heat_template_version' in raw_template.template
|
||||
|
|
|
@ -14,17 +14,20 @@ import copy
|
|||
|
||||
from migrate.versioning import util as migrate_util
|
||||
import six
|
||||
import sqlalchemy
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from heat.common.i18n import _
|
||||
from heat.db.sqlalchemy import models
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
Session = sessionmaker(bind=migrate_engine)
|
||||
session = Session()
|
||||
|
||||
raw_templates = session.query(models.RawTemplate).all()
|
||||
meta = sqlalchemy.MetaData(bind=migrate_engine)
|
||||
|
||||
templ_table = sqlalchemy.Table('raw_template', meta, autoload=True)
|
||||
raw_templates = templ_table.select().execute()
|
||||
|
||||
CFN_TO_HOT_RESOURCE_ATTRS = {'Type': 'type',
|
||||
'Properties': 'properties',
|
||||
|
|
|
@ -14,17 +14,20 @@ import copy
|
|||
import time
|
||||
|
||||
from migrate.versioning import util as migrate_util
|
||||
import sqlalchemy
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from heat.common.i18n import _
|
||||
from heat.db.sqlalchemy import models
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
Session = sessionmaker(bind=migrate_engine)
|
||||
session = Session()
|
||||
|
||||
raw_templates = session.query(models.RawTemplate).all()
|
||||
meta = sqlalchemy.MetaData(bind=migrate_engine)
|
||||
|
||||
templ_table = sqlalchemy.Table('raw_template', meta, autoload=True)
|
||||
raw_templates = templ_table.select().execute()
|
||||
|
||||
# NOTE (sdake) 2014-04-24 is the date of the Icehouse release. It is
|
||||
# possible that folks could continue to make errors in their templates
|
||||
|
|
Loading…
Reference in New Issue