mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Appease the linter
This commit is contained in:
parent
5947d4ebbf
commit
814aaeb1d2
@ -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
|
||||
|
||||
|
@ -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()}"}
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user