From 0ea558b98819311f25745fb85fc8f74ca0bc3a84 Mon Sep 17 00:00:00 2001 From: Firmlyzhu Date: Tue, 7 May 2019 18:29:59 +0800 Subject: [PATCH] Fix some bugs --- src/master/releasemgr.py | 2 +- src/utils/env.py | 4 ++-- src/utils/manage.py | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/master/releasemgr.py b/src/master/releasemgr.py index 1d75eb6..2d276fd 100644 --- a/src/master/releasemgr.py +++ b/src/master/releasemgr.py @@ -1,4 +1,4 @@ -import threading, time +import threading, time, requests, json from utils import env from utils.log import logger from utils.model import db, VCluster, Container diff --git a/src/utils/env.py b/src/utils/env.py index 16eacb5..b75bca0 100755 --- a/src/utils/env.py +++ b/src/utils/env.py @@ -80,9 +80,9 @@ def getenv(key): elif key =="ALLOW_SCALE_OUT": return os.environ.get("ALLOW_SCALE_OUT", "False") elif key == "WARNING_DAYS": - return os.environ.get("WARNING_DAYS"."7") + return os.environ.get("WARNING_DAYS", "7") elif key == "RELEASE_DAYS": - return os.environ.get("RELEASE_DAYS"."14") + return os.environ.get("RELEASE_DAYS", "14") elif key == "BATCH_ON": return os.environ.get("BATCH_ON","True") elif key == "BATCH_MASTER_PORT": diff --git a/src/utils/manage.py b/src/utils/manage.py index f947b9a..67e4940 100644 --- a/src/utils/manage.py +++ b/src/utils/manage.py @@ -1,5 +1,8 @@ +import sys +if sys.path[0].endswith("utils"): + sys.path[0] = sys.path[0][:-5] from flask_migrate import Migrate,MigrateCommand -from model import * +from utils.model import * from flask_script import Manager from flask import Flask