Appease the linter

This commit is contained in:
Silversthorn 2023-10-08 22:02:13 +02:00
parent 5947d4ebbf
commit 814aaeb1d2
3 changed files with 8 additions and 10 deletions

View File

@ -1,13 +1,7 @@
import logging
import typing as t
from prometheus_client import (
REGISTRY,
CollectorRegistry,
GC_COLLECTOR,
PLATFORM_COLLECTOR,
PROCESS_COLLECTOR,
)
from prometheus_client import REGISTRY, CollectorRegistry
from prometheus_client.exposition import _bake_output
from prometheus_client.exposition import parse_qs, urlparse

View File

@ -11,7 +11,9 @@ class ApiOpenMetricsIndexHandler(BaseMetricsHandler):
if not auth_data:
return
version = f"{self.helper.get_version().get('major')}.{self.helper.get_version().get('minor')}.{self.helper.get_version().get('sub')}"
version = f"{self.helper.get_version().get('major')} \
.{self.helper.get_version().get('minor')} \
.{self.helper.get_version().get('sub')}"
CRAFTY_INFO.info(
{"version": version, "docker": f"{self.helper.is_env_docker()}"}
)

View File

@ -1,4 +1,3 @@
from prometheus_client import Gauge
from prometheus_client.exposition import _bake_output
from prometheus_client.exposition import parse_qs, urlparse
@ -19,7 +18,10 @@ class ApiOpenMetricsServersHandler(BaseMetricsHandler):
self.get_registry(server_id)
def get_registry(self, server_id) -> None:
def get_registry(self, server_id=None) -> None:
if server_id is None:
return self.finish_json(500, {"status": "error", "error": "UNKNOWN_SERVER"})
# Prepare parameters
registry = (
ServersController().get_server_instance_by_id(server_id).server_registry