From b4f088a338f267bfbc5cd8fe6602cc3be9a50d2e Mon Sep 17 00:00:00 2001 From: rabbitali Date: Wed, 25 Oct 2023 19:40:17 +0800 Subject: [PATCH] update timed task arg check --- 0008-update-timed-task-args-check.patch | 32 +++++++++++++++++++++++++ aops-vulcanus.spec | 6 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0008-update-timed-task-args-check.patch diff --git a/0008-update-timed-task-args-check.patch b/0008-update-timed-task-args-check.patch new file mode 100644 index 0000000..f7e07b1 --- /dev/null +++ b/0008-update-timed-task-args-check.patch @@ -0,0 +1,32 @@ +From 8da5f67a67240f1bcc3f3f9d8cd8e6d5b20eb303 Mon Sep 17 00:00:00 2001 +From: rabbitali +Date: Wed, 25 Oct 2023 19:06:52 +0800 +Subject: [PATCH] update timed task args check + +--- + vulcanus/timed.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/vulcanus/timed.py b/vulcanus/timed.py +index 7d31bee..9657da0 100644 +--- a/vulcanus/timed.py ++++ b/vulcanus/timed.py +@@ -94,11 +94,11 @@ class TimedTask: + LOGGER.error("Wrong trigger parameter for timed tasks : %s.", trigger) + return False + +- if "day_of_week" not in timed or "hour" not in timed or "minutes" not in timed: +- LOGGER.error("Missing required fields when creating scheduled task.") +- return False ++ if ("day_of_week" in timed and "hour" in timed) or ("minutes" in timed): ++ return True + +- return True ++ LOGGER.error("Missing required fields when creating scheduled task.") ++ return False + + + class TimedTaskManager: +-- +2.33.0 + diff --git a/aops-vulcanus.spec b/aops-vulcanus.spec index d962336..4eb3365 100644 --- a/aops-vulcanus.spec +++ b/aops-vulcanus.spec @@ -1,6 +1,6 @@ Name: aops-vulcanus Version: v1.3.0 -Release: 6 +Release: 7 Summary: A basic tool libraries of aops, including logging, configure and response, etc. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -12,6 +12,7 @@ Patch0004: 0004-fix-information-path-incorrect.patch Patch0005: 0005-suitable-for-version-2003-sp3.patch Patch0006: 0006-fix-python3-prometheus-api-client-import-error.patch Patch0007: 0007-update-timed-task-args-check-and-timeout.patch +Patch0008: 0008-update-timed-task-args-check.patch BuildRequires: python3-setuptools @@ -67,6 +68,9 @@ cp -r scripts %{buildroot}/opt/aops/ %changelog +* Wed Oct 25 2023 wenxin - v1.3.0-7 +- update timed task args check + * Wed Oct 25 2023 wenxin - v1.3.0-6 - since there is no arm-arch package in new repo source, remove changes of the es repo source url