Skip to content

Commit

Permalink
fix(provider): deprecated package in Grafana provider (keephq#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored May 23, 2024
1 parent 2ee73b5 commit 7bf93f4
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 24 deletions.
4 changes: 2 additions & 2 deletions keep/providers/grafana_provider/grafana_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pydantic
import requests
from grafana_api.model import APIEndpoints
from pkg_resources import packaging
from packaging.version import Version

from keep.api.models.alert import AlertDto, AlertSeverity, AlertStatus
from keep.contextmanager.contextmanager import ContextManager
Expand Down Expand Up @@ -268,7 +268,7 @@ def setup_webhook(
raise
self.logger.info(f"Grafana version is {grafana_version}")
# if grafana version is greater then 9.4.7 we can use the digest token
if packaging.version.parse(grafana_version) > packaging.version.parse("9.4.7"):
if Version(grafana_version) > Version("9.4.7"):
self.logger.info("Installing Grafana version > 9.4.7")
if webhook_exists:
webhook = webhook_exists[0]
Expand Down
Loading

0 comments on commit 7bf93f4

Please sign in to comment.