1 Star 0 Fork 36

wangjh/A-Tune

forked from src-openEuler/A-Tune 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
check-whether-the-certificate-file-exists.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
From 8d7596125161bea13641644fca2384411e00a4e5 Mon Sep 17 00:00:00 2001
From: gaoruoshu <[email protected]>
Date: Tue, 15 Feb 2022 17:03:40 +0800
Subject: [PATCH] check whether the certificate file exists
---
analysis/app.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/analysis/app.py b/analysis/app.py
index 31b5f51..b25e784 100644
--- a/analysis/app.py
+++ b/analysis/app.py
@@ -22,6 +22,8 @@ from logging.handlers import SysLogHandler
from flask import Flask
from flask_restful import Api
+LOGGER = logging.getLogger(__name__)
+
class App:
"""flask application"""
@@ -51,6 +51,9 @@ class App:
def startup_app(self, host, port, tls, cert_file, key_file, ca_file, log_level):
"""start flask app"""
+ if not os.path.exists(cert_file) or not os.path.exists(key_file) or not os.path.exists(ca_file):
+ LOGGER.error("Startup failed. Please provide the authentication certificate.")
+ raise FileNotFoundError("Startup failed. Please provide the authentication certificate.")
level = logging.getLevelName(log_level.upper())
self.config_log(level)
self.add_resource()
--
2.30.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangjh1121/A-Tune.git
[email protected]:wangjh1121/A-Tune.git
wangjh1121
A-Tune
A-Tune
master

搜索帮助