Skip to content

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jennchenn committed Feb 12, 2024
1 parent 7ff77af commit 00b31dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion kubelet/datadog_checks/kubelet/kubelet.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ class KubeletCheck(

def __init__(self, name, init_config, instances):
if os.getenv("DD_KUBERNETES_KUBELET_CORE_CHECK_ENABLED") == "true":
raise SkipInstanceError("The kubelet core check is enabled, skipping initialization of the python kubelet check")
raise SkipInstanceError(
"The kubelet core check is enabled, skipping initialization of the python kubelet check"
)
self.KUBELET_METRIC_TRANSFORMERS = {
'kubelet_container_log_filesystem_used_bytes': self.kubelet_container_log_filesystem_used_bytes,
'rest_client_request_latency_seconds': self.rest_client_latency,
Expand Down
4 changes: 2 additions & 2 deletions kubelet/tests/test_kubelet.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from datadog_checks.base.checks.kubelet_base.base import KubeletCredentials
from datadog_checks.base.errors import SkipInstanceError
from datadog_checks.base.utils.date import parse_rfc3339
from datadog_checks.base.errors import SkipInstanceError
from datadog_checks.dev.http import MockResponse
from datadog_checks.kubelet import KubeletCheck, PodListUtils

Expand Down Expand Up @@ -1564,8 +1563,9 @@ def test_kubelet_unavailable_check_can_init(monkeypatch):
check = mock_kubelet_check(monkeypatch, [instance], kube_version=None)
assert check is not None


def test_kubelet_does_not_init_if_config_var_set_to_true(monkeypatch):
monkeypatch.setenv("DD_KUBERNETES_KUBELET_CORE_CHECK_ENABLED", "true")
with pytest.raises(SkipInstanceError):
KubeletCheck('kubelet', {}, [{}])
return
return

0 comments on commit 00b31dc

Please sign in to comment.