Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed Sep 26, 2024
1 parent 0353c76 commit dee3c38
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions keep/providers/ilert_provider/ilert_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from keep.providers.providers_factory import ProvidersFactory


class ilertIncidentStatus(str, enum.Enum):
class IlertIncidentStatus(str, enum.Enum):
"""
ilert incident status.
"""
Expand All @@ -30,7 +30,7 @@ class ilertIncidentStatus(str, enum.Enum):


@pydantic.dataclasses.dataclass
class ilertProviderAuthConfig:
class IlertProviderAuthConfig:
"""
ilert authentication configuration.
"""
Expand All @@ -53,9 +53,10 @@ class ilertProviderAuthConfig:
)


class ilertProvider(BaseProvider):
class IlertProvider(BaseProvider):
"""Create/Resolve incidents in ilert."""

PROVIDER_DISPLAY_NAME = "ilert"
PROVIDER_SCOPES = [
ProviderScope("read_permission", "Read permission", mandatory=True),
ProviderScope("write_permission", "Write permission", mandatory=False),
Expand Down Expand Up @@ -92,7 +93,7 @@ def validate_config(self):
Validates required configuration for ilert provider.
"""
self.authentication_config = ilertProviderAuthConfig(
self.authentication_config = IlertProviderAuthConfig(
**self.config.authentication
)

Expand Down Expand Up @@ -187,10 +188,10 @@ def _get_alerts(self) -> list[AlertDto]:

alert_dtos = []
for alert in alerts:
severity = ilertProvider.SEVERITIES_MAP.get(
severity = IlertProvider.SEVERITIES_MAP.get(
alert.get("affectedServices", [{}])[0].get("impact", "OPERATIONAL")
)
status = ilertProvider.STATUS_MAP.get(
status = IlertProvider.STATUS_MAP.get(
alert.get("status"), AlertStatus.ACKNOWLEDGED
)
alert_dto = AlertDto(
Expand Down Expand Up @@ -322,7 +323,7 @@ def _notify(
self,
_type: Literal["incident", "event"] = "event",
summary: str = "",
status: ilertIncidentStatus = ilertIncidentStatus.INVESTIGATING,
status: IlertIncidentStatus = IlertIncidentStatus.INVESTIGATING,
message: str = "",
affectedServices: str | list = "[]",
id: str = "0",
Expand Down Expand Up @@ -371,7 +372,7 @@ def _notify(
provider_config = {
"authentication": {"ilert_token": api_key, "ilert_host": host},
}
provider: ilertProvider = ProvidersFactory.get_provider(
provider: IlertProvider = ProvidersFactory.get_provider(
context_manager=context_manager,
provider_id="ilert",
provider_type="ilert",
Expand Down

0 comments on commit dee3c38

Please sign in to comment.