diff --git a/Dockerfile b/Dockerfile index 35835f1aa..e976be484 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8.18-slim +FROM python:3.9-slim ENV PYTHONUNBUFFERED 1 ENV PIP_DISABLE_PIP_VERSION_CHECK=1 diff --git a/alerta/models/alert.py b/alerta/models/alert.py index 8b828132f..09f4d42c0 100644 --- a/alerta/models/alert.py +++ b/alerta/models/alert.py @@ -1,6 +1,7 @@ import os import platform import sys +import logging from datetime import datetime from typing import Optional # noqa from typing import Any, Dict, List, Tuple, Union @@ -141,7 +142,8 @@ def parse(cls, json: JSON) -> 'Alert': if rudder_resource_type is None or rudder_resource_id is None: rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags) if rudder_resource_type is None or rudder_resource_id is None: - raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too') + logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') + raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') return Alert( id=json.get('id', None), @@ -269,7 +271,8 @@ def from_document(cls, doc: Dict[str, Any]) -> 'Alert': if rudder_resource_type is None or rudder_resource_id is None: rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags) if rudder_resource_type is None or rudder_resource_id is None: - raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too') + logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') + raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') return Alert( id=doc.get('id', None) or doc.get('_id'), resource=doc.get('resource', None), @@ -328,7 +331,8 @@ def from_record(cls, rec) -> 'Alert': if rudder_resource_type is None or rudder_resource_id is None: rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags) if rudder_resource_type is None or rudder_resource_id is None: - raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too') + logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') + raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') return Alert( id=rec.id, diff --git a/alerta/webhooks/prometheus.py b/alerta/webhooks/prometheus.py index 1d4bd1662..6988f9a1e 100644 --- a/alerta/webhooks/prometheus.py +++ b/alerta/webhooks/prometheus.py @@ -1,3 +1,4 @@ +import logging import datetime from typing import Any, Dict @@ -86,7 +87,8 @@ def parse_prometheus(alert: JSON, external_url: str) -> Alert: if rudder_resource_type is None or rudder_resource_id is None: rudder_resource_type, rudder_resource_id = get_rudder_resource_from_tags(tags) if rudder_resource_type is None or rudder_resource_id is None: - raise ValueError('rudder_resource_type or rudder_resource_id missing - couldnt parse them from tags too') + logging.error('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') + raise ValueError('rudder_resource_type or rudder_resource_id missing - could not parse them from tags too') return Alert( resource=resource, diff --git a/package.json b/package.json index 0673f529d..1edf7ff58 100644 --- a/package.json +++ b/package.json @@ -1,3 +1,3 @@ { - "version": "2.3.0" + "version": "2.4.0" } \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index c0d2dd42b..d6a6f313a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,9 @@ mypy==0.910 -pre-commit==2.15.0 -pylint==2.11.1 +pre-commit==3.7.0 +pylint==3.1.0 pytest-cov pytest>=5.4.3 python-dotenv requests_mock twine -wheel==0.38.0 +setuptools>=70.0.0 \ No newline at end of file diff --git a/requirements-docker.txt b/requirements-docker.txt index 8812ce4ae..c9ab38ccb 100644 --- a/requirements-docker.txt +++ b/requirements-docker.txt @@ -1,5 +1,5 @@ lxml==4.6.5 pysaml2==6.5.1 python-ldap==3.3.1 -gunicorn==20.1.0 +gunicorn==22.0.0 gevent==23.9.0 diff --git a/requirements.txt b/requirements.txt index b918e7177..de74c144e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ bcrypt==3.2.0 blinker==1.6.2 -cryptography==42.0.2 +cryptography==43.0.1 Flask==2.2.5 Flask-Compress==1.10.1 Flask-Cors==3.0.10