From 9054768f8c5e62f0a355897e1d307940515fc5d8 Mon Sep 17 00:00:00 2001 From: gaoruoshu Date: Fri, 5 Aug 2022 15:39:45 +0800 Subject: [PATCH] fix start failed of atuned service --- atune.spec | 6 ++++- fix-start-failed-of-atuned-service.patch | 34 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 fix-start-failed-of-atuned-service.patch diff --git a/atune.spec b/atune.spec index 55fb0b7..075aeb2 100755 --- a/atune.spec +++ b/atune.spec @@ -3,7 +3,7 @@ Summary: AI auto tuning system Name: atune Version: 1.0.0 -Release: 4 +Release: 5 License: MulanPSL-2.0 URL: https://gitee.com/openeuler/A-Tune Source: https://gitee.com/openeuler/A-Tune/repository/archive/v%{version}.tar.gz @@ -11,6 +11,7 @@ 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: change-Makefile-A-Tune-version-to-1.0.0.patch +Patch9003: fix-start-failed-of-atuned-service.patch BuildRequires: rpm-build golang-bin procps-ng BuildRequires: sqlite >= 3.24.0 openssl @@ -147,6 +148,9 @@ atune engine tool for manage atuned AI tuning system. %systemd_postun_with_restart atuned.service %changelog +* Fri Aug 05 2022 gaoruoshu - 1.0.0-5 +- fix start failed of atuned service + * Fri Aug 05 2022 fushanqing - 1.0.0-4 - Unified license name specification diff --git a/fix-start-failed-of-atuned-service.patch b/fix-start-failed-of-atuned-service.patch new file mode 100644 index 0000000..951a5ee --- /dev/null +++ b/fix-start-failed-of-atuned-service.patch @@ -0,0 +1,34 @@ +From 945560933e7e118b9113f152a5f133e1ff0af183 Mon Sep 17 00:00:00 2001 +From: g00563147 +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 +