From 98a573bbc7f497986d852f4ecd7e99ac4423b04b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 6 Nov 2020 20:39:18 -0500 Subject: [PATCH] Lint: E402 module level import not at top of file --- api-daemon/migrations/env.py | 2 +- api-daemon/pvcapid/flaskapi.py | 5 ++--- node-daemon/pvcnoded/Daemon.py | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api-daemon/migrations/env.py b/api-daemon/migrations/env.py index 23663ff2..0ecfdf8f 100644 --- a/api-daemon/migrations/env.py +++ b/api-daemon/migrations/env.py @@ -2,6 +2,7 @@ from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig +from flask import current_app import logging # this is the Alembic Config object, which provides @@ -17,7 +18,6 @@ logger = logging.getLogger('alembic.env') # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata -from flask import current_app config.set_main_option('sqlalchemy.url', current_app.config.get('SQLALCHEMY_DATABASE_URI')) target_metadata = current_app.extensions['migrate'].db.metadata diff --git a/api-daemon/pvcapid/flaskapi.py b/api-daemon/pvcapid/flaskapi.py index f3ab5bee..ecffd105 100755 --- a/api-daemon/pvcapid/flaskapi.py +++ b/api-daemon/pvcapid/flaskapi.py @@ -36,6 +36,8 @@ import pvcapid.ova as api_ova from flask_sqlalchemy import SQLAlchemy +from pvcapid.models import * + API_VERSION = 1.0 def strtobool(stringv): @@ -125,9 +127,6 @@ if config['auth_enabled']: # Create SQLAlchemy database db = SQLAlchemy(app) -# Import database models -from pvcapid.models import * - # Create Flask blueprint blueprint = flask.Blueprint('api', __name__, url_prefix='/api/v1') diff --git a/node-daemon/pvcnoded/Daemon.py b/node-daemon/pvcnoded/Daemon.py index bdac4a13..7abee370 100644 --- a/node-daemon/pvcnoded/Daemon.py +++ b/node-daemon/pvcnoded/Daemon.py @@ -20,9 +20,6 @@ # ############################################################################### -# Version string for startup output -version = '0.9.1' - import kazoo.client import libvirt import sys @@ -56,6 +53,9 @@ import pvcnoded.DNSAggregatorInstance as DNSAggregatorInstance import pvcnoded.CephInstance as CephInstance import pvcnoded.MetadataAPIInstance as MetadataAPIInstance +# Version string for startup output +version = '0.9.1' + ############################################################################### # PVCD - node daemon startup program ###############################################################################