Lint: E402 module level import not at top of file
This commit is contained in:
		| @@ -2,6 +2,7 @@ from __future__ import with_statement | |||||||
| from alembic import context | from alembic import context | ||||||
| from sqlalchemy import engine_from_config, pool | from sqlalchemy import engine_from_config, pool | ||||||
| from logging.config import fileConfig | from logging.config import fileConfig | ||||||
|  | from flask import current_app | ||||||
| import logging | import logging | ||||||
|  |  | ||||||
| # this is the Alembic Config object, which provides | # this is the Alembic Config object, which provides | ||||||
| @@ -17,7 +18,6 @@ logger = logging.getLogger('alembic.env') | |||||||
| # for 'autogenerate' support | # for 'autogenerate' support | ||||||
| # from myapp import mymodel | # from myapp import mymodel | ||||||
| # target_metadata = mymodel.Base.metadata | # target_metadata = mymodel.Base.metadata | ||||||
| from flask import current_app |  | ||||||
| config.set_main_option('sqlalchemy.url', | config.set_main_option('sqlalchemy.url', | ||||||
|                        current_app.config.get('SQLALCHEMY_DATABASE_URI')) |                        current_app.config.get('SQLALCHEMY_DATABASE_URI')) | ||||||
| target_metadata = current_app.extensions['migrate'].db.metadata | target_metadata = current_app.extensions['migrate'].db.metadata | ||||||
|   | |||||||
| @@ -36,6 +36,8 @@ import pvcapid.ova as api_ova | |||||||
|  |  | ||||||
| from flask_sqlalchemy import SQLAlchemy | from flask_sqlalchemy import SQLAlchemy | ||||||
|  |  | ||||||
|  | from pvcapid.models import * | ||||||
|  |  | ||||||
| API_VERSION = 1.0 | API_VERSION = 1.0 | ||||||
|  |  | ||||||
| def strtobool(stringv): | def strtobool(stringv): | ||||||
| @@ -125,9 +127,6 @@ if config['auth_enabled']: | |||||||
| # Create SQLAlchemy database | # Create SQLAlchemy database | ||||||
| db = SQLAlchemy(app) | db = SQLAlchemy(app) | ||||||
|  |  | ||||||
| # Import database models |  | ||||||
| from pvcapid.models import * |  | ||||||
|  |  | ||||||
| # Create Flask blueprint | # Create Flask blueprint | ||||||
| blueprint = flask.Blueprint('api', __name__, url_prefix='/api/v1') | blueprint = flask.Blueprint('api', __name__, url_prefix='/api/v1') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,9 +20,6 @@ | |||||||
| # | # | ||||||
| ############################################################################### | ############################################################################### | ||||||
|  |  | ||||||
| # Version string for startup output |  | ||||||
| version = '0.9.1' |  | ||||||
|  |  | ||||||
| import kazoo.client | import kazoo.client | ||||||
| import libvirt | import libvirt | ||||||
| import sys | import sys | ||||||
| @@ -56,6 +53,9 @@ import pvcnoded.DNSAggregatorInstance as DNSAggregatorInstance | |||||||
| import pvcnoded.CephInstance as CephInstance | import pvcnoded.CephInstance as CephInstance | ||||||
| import pvcnoded.MetadataAPIInstance as MetadataAPIInstance | import pvcnoded.MetadataAPIInstance as MetadataAPIInstance | ||||||
|  |  | ||||||
|  | # Version string for startup output | ||||||
|  | version = '0.9.1' | ||||||
|  |  | ||||||
| ############################################################################### | ############################################################################### | ||||||
| # PVCD - node daemon startup program | # PVCD - node daemon startup program | ||||||
| ############################################################################### | ############################################################################### | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user