fix: [Flask] fix json type parsing

visu-type
Terrtia 2019-03-13 11:31:49 +01:00
parent 6a82c5c020
commit b6c18f606b
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 6 additions and 2 deletions

View File

@ -51,6 +51,12 @@ redis_server_analyzer = redis.StrictRedis(
db=2,
decode_responses=True)
with open(json_type_description_path, 'r') as f:
json_type = json.loads(f.read())
json_type_description = {}
for type_info in json_type:
json_type_description[type_info['type']] = type_info
app = Flask(__name__, static_url_path=baseUrl+'/static/')
app.config['MAX_CONTENT_LENGTH'] = 900 * 1024 * 1024
@ -90,8 +96,6 @@ def get_server_management_input_handler_value(value):
return value
def get_json_type_description():
with open(json_type_description_path, 'r') as f:
json_type_description = json.loads(f.read())
return json_type_description
def get_whois_ouput(ip):