Order imports in alphabetical order (4/9)

This patch is one in a series to re-enable H306 style check rule
(imports are in alphabetical order). It touches db files.

Implements: blueprint reduce-flake8-ignored-rules (partial)
Change-Id: I66842c6a5d112f948e625e18ef6d01afcad61e57
This commit is contained in:
Pavlo Shchelokovskyy 2014-02-06 14:09:11 +02:00
parent 6e2412a468
commit 5be43b045a
11 changed files with 29 additions and 24 deletions

View File

@ -13,18 +13,14 @@
# under the License. # under the License.
'''Implementation of SQLAlchemy backend.''' '''Implementation of SQLAlchemy backend.'''
import sys
from datetime import datetime from datetime import datetime
from datetime import timedelta from datetime import timedelta
import sys
from oslo.config import cfg from oslo.config import cfg
import sqlalchemy import sqlalchemy
from sqlalchemy.orm.session import Session from sqlalchemy.orm.session import Session
cfg.CONF.import_opt('max_events_per_stack', 'heat.common.config')
from heat.openstack.common.gettextutils import _
from heat.common import crypt from heat.common import crypt
from heat.common import exception from heat.common import exception
from heat.db.sqlalchemy import filters as db_filters from heat.db.sqlalchemy import filters as db_filters
@ -32,7 +28,9 @@ from heat.db.sqlalchemy import migration
from heat.db.sqlalchemy import models from heat.db.sqlalchemy import models
from heat.openstack.common.db.sqlalchemy import session as db_session from heat.openstack.common.db.sqlalchemy import session as db_session
from heat.openstack.common.db.sqlalchemy import utils from heat.openstack.common.db.sqlalchemy import utils
from heat.openstack.common.gettextutils import _
cfg.CONF.import_opt('max_events_per_stack', 'heat.common.config')
get_engine = db_session.get_engine get_engine = db_session.get_engine
get_session = db_session.get_session get_session = db_session.get_session

View File

@ -13,9 +13,9 @@
import uuid import uuid
from migrate.versioning import util as migrate_util
import sqlalchemy import sqlalchemy
from migrate.versioning import util as migrate_util
from heat.openstack.common.gettextutils import _ from heat.openstack.common.gettextutils import _

View File

@ -10,9 +10,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import sqlalchemy
import uuid import uuid
import sqlalchemy
def upgrade(migrate_engine): def upgrade(migrate_engine):
meta = sqlalchemy.MetaData(bind=migrate_engine) meta = sqlalchemy.MetaData(bind=migrate_engine)

View File

@ -12,6 +12,7 @@
# under the License. # under the License.
import sqlalchemy import sqlalchemy
from heat.db.sqlalchemy.types import Json from heat.db.sqlalchemy.types import Json

View File

@ -11,11 +11,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import uuid
import itertools import itertools
import sqlalchemy import uuid
import migrate.changeset.constraint as constraint import migrate.changeset.constraint as constraint
import sqlalchemy
from heat.openstack.common import timeutils from heat.openstack.common import timeutils

View File

@ -11,12 +11,13 @@
# under the License. # under the License.
import copy import copy
from migrate.versioning import util as migrate_util from migrate.versioning import util as migrate_util
from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import sessionmaker
from heat.openstack.common.gettextutils import _
from heat.db.sqlalchemy import models from heat.db.sqlalchemy import models
from heat.engine.hot.parameters import HOTParamSchema from heat.engine.hot.parameters import HOTParamSchema
from heat.openstack.common.gettextutils import _
def upgrade(migrate_engine): def upgrade(migrate_engine):

View File

@ -11,11 +11,11 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from heat.db.sqlalchemy.types import LongText
from heat.db.sqlalchemy.types import Json
import sqlalchemy import sqlalchemy
from heat.db.sqlalchemy.types import Json
from heat.db.sqlalchemy.types import LongText
def upgrade(migrate_engine): def upgrade(migrate_engine):
meta = sqlalchemy.MetaData(bind=migrate_engine) meta = sqlalchemy.MetaData(bind=migrate_engine)

View File

@ -11,11 +11,12 @@
# under the License. # under the License.
import copy import copy
from migrate.versioning import util as migrate_util from migrate.versioning import util as migrate_util
from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import sessionmaker
from heat.openstack.common.gettextutils import _
from heat.db.sqlalchemy import models from heat.db.sqlalchemy import models
from heat.openstack.common.gettextutils import _
def upgrade(migrate_engine): def upgrade(migrate_engine):

View File

@ -17,14 +17,15 @@ SQLAlchemy models for heat data.
import uuid import uuid
import sqlalchemy import sqlalchemy
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
from heat.openstack.common import timeutils from sqlalchemy.orm import backref
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import Session
from heat.db.sqlalchemy.types import Json
from heat.openstack.common.db.sqlalchemy import models from heat.openstack.common.db.sqlalchemy import models
from heat.openstack.common.db.sqlalchemy import session from heat.openstack.common.db.sqlalchemy import session
from sqlalchemy.orm.session import Session from heat.openstack.common import timeutils
from heat.db.sqlalchemy.types import Json
BASE = declarative_base() BASE = declarative_base()
get_session = session.get_session get_session = session.get_session

View File

@ -13,8 +13,9 @@
from json import dumps from json import dumps
from json import loads from json import loads
from sqlalchemy import types
from sqlalchemy.dialects import mysql from sqlalchemy.dialects import mysql
from sqlalchemy import types
class LongText(types.TypeDecorator): class LongText(types.TypeDecorator):

View File

@ -17,14 +17,14 @@ from __future__ import print_function
import sys import sys
from oslo.config import cfg
from heat.db import migration
from heat.openstack.common import gettextutils from heat.openstack.common import gettextutils
from heat.openstack.common import log as logging
gettextutils.install('heat') gettextutils.install('heat')
from oslo.config import cfg
from heat.openstack.common import log as logging
from heat.db import migration
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)