init 24.03-lts-sp1

This commit is contained in:
rearcher 2024-11-19 11:04:56 +08:00
parent d7161ff4cc
commit 54bc4b42fe
6 changed files with 27 additions and 125 deletions

View File

@ -1,45 +0,0 @@
From 77f2c6a864baac31d7e6b4bee924dad82214092c Mon Sep 17 00:00:00 2001
From: rabbitali <wenxin32@foxmail.com>
Date: Wed, 20 Dec 2023 15:37:29 +0800
Subject: [PATCH] update ValidateRules
---
vulcanus/restful/serialize/validate.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/vulcanus/restful/serialize/validate.py b/vulcanus/restful/serialize/validate.py
index d6eacbe..3050693 100644
--- a/vulcanus/restful/serialize/validate.py
+++ b/vulcanus/restful/serialize/validate.py
@@ -64,7 +64,7 @@ class ValidateRules:
"""
validation rules for username, which only contains string or number
"""
- if not re.findall("[a-zA-Z0-9]{5,20}", string):
+ if not re.findall("^[a-zA-Z0-9]{5,20}$", string):
raise ValidationError("username should only contains string or number, between 5 and 20 characters!")
@staticmethod
@@ -72,8 +72,18 @@ class ValidateRules:
"""
validation rules for password, which only contains string or number
"""
- if not re.findall("[a-zA-Z0-9]{6,20}", string):
+ if not re.findall("^[a-zA-Z0-9]{6,20}$", string):
raise ValidationError("password should only contains string or number, between 6 and 20 characters!!")
+
+ @staticmethod
+ def ipv4_address_check(string: str):
+ """
+ validation rules for IPV4 address
+ """
+ ipv4_address_pattern = r"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
+ if not re.findall(ipv4_address_pattern, string):
+ raise ValidationError("Not a valid IPV4 address.")
+
class PaginationSchema(Schema):
--
2.33.0

View File

@ -1,41 +0,0 @@
From dfd2f38fd34d300448ed9231377fcf4a0be7d367 Mon Sep 17 00:00:00 2001
From: zhu-yuncheng <zhuyuncheng@huawei.com>
Date: Sat, 23 Dec 2023 17:43:18 +0800
Subject: [PATCH] add httpconnection error catch when connect prometheus
---
vulcanus/database/proxy.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/vulcanus/database/proxy.py b/vulcanus/database/proxy.py
index 94e9883..5753066 100644
--- a/vulcanus/database/proxy.py
+++ b/vulcanus/database/proxy.py
@@ -16,9 +16,9 @@ Author:
Description: Database proxy
"""
from functools import wraps
-import math
from datetime import datetime
from urllib3.exceptions import LocationValueError
+from requests.exceptions import ConnectionError
import sqlalchemy
from sqlalchemy.exc import SQLAlchemyError, DisconnectionError
@@ -543,8 +543,12 @@ class PromDbProxy(DataBaseProxy):
Returns:
bool: connect succeed or fail
"""
-
- return self._prom.check_prometheus_connection()
+ connected = False
+ try:
+ connected = self._prom.check_prometheus_connection()
+ except ConnectionError as error:
+ LOGGER.error(error)
+ return connected
def query(self, host, time_range, metric, label_config=None):
"""
--
Gitee

View File

@ -1,25 +0,0 @@
From b0dbdbf4c4992308f738d6ea74a9e3e21fc65129 Mon Sep 17 00:00:00 2001
From: rabbitali <wenxin32@foxmail.com>
Date: Wed, 27 Dec 2023 10:39:30 +0800
Subject: [PATCH] Update the exception catching type of the function
---
vulcanus/database/proxy.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vulcanus/database/proxy.py b/vulcanus/database/proxy.py
index 94e9883..4e62527 100644
--- a/vulcanus/database/proxy.py
+++ b/vulcanus/database/proxy.py
@@ -108,7 +108,7 @@ class MysqlProxy(DataBaseProxy):
"""
try:
self._create_session()
- except sqlalchemy.exc.SQLAlchemyError as error:
+ except DatabaseConnectionFailed as error:
LOGGER.error(error)
return False
--
2.33.0

Binary file not shown.

BIN
aops-vulcanus-v2.1.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,21 +1,18 @@
Name: aops-vulcanus
Version: v1.3.1
Release: 4
Version: v2.1.0
Release: 2
Summary: A basic tool libraries of aops, including logging, configure and response, etc.
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-update-ValidateRules.patch
Patch0002: 0002-add-error-catch-when-connect-pro.patch
Patch0003: 0003-update-the-exception-catching-type-of-the-function.patch
BuildRequires: python3-setuptools
Requires: python3-concurrent-log-handler python3-xmltodict python3-pyyaml python3-marshmallow >= 3.13.0
Requires: python3-requests python3-xlrd python3-prettytable python3-pygments python3-sqlalchemy
Requires: python3-elasticsearch >= 7 python3-elasticsearch < 8 python3-prometheus-api-client python3-urllib3 python3-werkzeug
Requires: python3-flask python3-flask-restful python3-PyMySQL python3-kafka-python
Requires: python-jwt python3-redis python3-Flask-APScheduler >= 1.11.0
Requires: python3-requests python3-xlrd python3-sqlalchemy
Requires: python3-elasticsearch >= 7 python3-elasticsearch < 8
Requires: python3-flask python3-flask-restful python3-PyMySQL python3-kafka-python python3-retrying
Requires: python-jwt python3-redis python3-Flask-APScheduler >= 1.11.0 python3-APScheduler python3-kazoo
Provides: aops-vulcanus
Conflicts: aops-utils
@ -33,7 +30,7 @@ tools for aops, it's about aops deploy
%prep
%autosetup -n %{name}-%{version} -p1
%autosetup -n %{name}-%{version}
# build for aops-vulcanus
@ -51,11 +48,9 @@ cp -r scripts %{buildroot}/opt/aops/
%files
%doc README.*
%attr(0644,root,root) %{_sysconfdir}/aops/system.ini
%attr(0640,root,root) %{_sysconfdir}/aops/.aops-private-config.ini
%attr(0644,root,root) %{_sysconfdir}/aops/aops-config.yml
%{python3_sitelib}/aops_vulcanus*.egg-info
%{python3_sitelib}/vulcanus/*
%attr(0755,root,root) %{_bindir}/aops-vulcanus
%files -n aops-tools
@ -63,6 +58,24 @@ cp -r scripts %{buildroot}/opt/aops/
%changelog
* Tue Nov 19 2024 luxuexian<luxuexian@huawei.com> - v2.1.0-2
- Modify the serialization of request input parameters.
* Mon Sep 9 2024 gongzhengtang<gong_zhengtang@163.com> - v2.1.0-1
- Adapt the token and constant additions for the authentication center.
* Wed Aug 28 2024 wenxin<wenxin32@foxmail.com> - v2.0.0-2
- Update http forwarding request headers.
* Fri Aug 16 2024 wenxin<wenxin32@foxmail.com> - v2.0.0-1
- Adjusted configuration file loading method: changed format from INI to YAML.
- Added support for reading and writing configuration through Zookeeper.
- Added support for reading and writing cache through Redis, including logic for current cache keys.
- Implemented RSA signature verification for data.
- Removed deprecated files.
- Optimized Prometheus import statements.
- Added retry mechanism to `response` method.
* Wed Dec 27 2023 wenxin<wenxin32@foxmail.com> - v1.3.1-4
- update the exception catching type of the function