[atune] fix start failed of atuned service

(cherry picked from commit db0be0b5e5f4ce22d7dc7f837ceeddc40a02541d)
This commit is contained in:
g00563147 2022-03-03 16:54:59 +08:00 committed by openeuler-sync-bot
parent e16d71ebec
commit 2a8988652b
2 changed files with 39 additions and 1 deletions

View File

@ -3,13 +3,14 @@
Summary: AI auto tuning system
Name: atune
Version: 1.0.0
Release: 2
Release: 3
License: Mulan PSL v2
URL: https://gitee.com/openeuler/A-Tune
Source: https://gitee.com/openeuler/A-Tune/repository/archive/v%{version}.tar.gz
Patch9000: check-whether-the-certificate-file-exists.patch
Patch9001: add-FAQ-and-self-signature-certificate-manufacturing.patch
Patch9002: fix-start-failed-of-atuned-service.patch
BuildRequires: rpm-build golang-bin procps-ng
BuildRequires: sqlite >= 3.24.0 openssl
@ -145,6 +146,9 @@ atune engine tool for manage atuned AI tuning system.
%systemd_postun_with_restart atuned.service
%changelog
* Thu Mar 03 2022 gaoruoshu <gaoruoshu@huawei.com> - 1.0.0-3
- fix start failed of atuned service
* Tue Feb 15 2022 gaoruoshu <gaoruoshu@huawei.com> - 1.0.0-2
- enable certificate authentication by default and modify file permissions

View File

@ -0,0 +1,34 @@
From 945560933e7e118b9113f152a5f133e1ff0af183 Mon Sep 17 00:00:00 2001
From: g00563147 <gaoruoshu@huawei.com>
Date: Thu, 3 Mar 2022 16:52:04 +0800
Subject: [PATCH] fix start failed of atuned service
---
analysis/app.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/analysis/app.py b/analysis/app.py
index e82e2b2..3a0c248 100644
--- a/analysis/app.py
+++ b/analysis/app.py
@@ -53,14 +53,14 @@ 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()
context = None
if tls:
+ 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.")
context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
context.load_cert_chain(certfile=cert_file, keyfile=key_file)
context.load_verify_locations(ca_file)
--
1.8.3.1