mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-11-15 22:20:39 +00:00
fix linting
This commit is contained in:
parent
1c801db6ae
commit
de0450b130
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from pathlib import Path, PurePath
|
from pathlib import Path, PurePath
|
||||||
|
from typing import ClassVar
|
||||||
|
|
||||||
import anyconfig
|
import anyconfig
|
||||||
import environs
|
import environs
|
||||||
@ -20,7 +21,7 @@ cache_dir = AppDirs("prometheus-pve-sd").user_cache_dir
|
|||||||
default_output_file = os.path.join(cache_dir, "pve.json")
|
default_output_file = os.path.join(cache_dir, "pve.json")
|
||||||
|
|
||||||
|
|
||||||
class Config():
|
class Config:
|
||||||
"""
|
"""
|
||||||
Create an object with all necessary settings.
|
Create an object with all necessary settings.
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ class Config():
|
|||||||
- provides cli parameters
|
- provides cli parameters
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SETTINGS = {
|
SETTINGS: ClassVar[dict[dict]] = {
|
||||||
"metrics.enabled": {
|
"metrics.enabled": {
|
||||||
"default": True,
|
"default": True,
|
||||||
"env": "METRICS_ENABLED",
|
"env": "METRICS_ENABLED",
|
||||||
|
@ -20,7 +20,7 @@ PROPAGATION_TIME = Summary(
|
|||||||
HOST_GAUGE = Gauge("pve_sd_hosts", "Number of hosts discovered by PVE SD")
|
HOST_GAUGE = Gauge("pve_sd_hosts", "Number of hosts discovered by PVE SD")
|
||||||
|
|
||||||
|
|
||||||
class Discovery():
|
class Discovery:
|
||||||
"""Prometheus PVE Service Discovery."""
|
"""Prometheus PVE Service Discovery."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"""Global utility methods and classes."""
|
"""Global utility methods and classes."""
|
||||||
|
|
||||||
from distutils.util import strtobool
|
from distutils.util import strtobool
|
||||||
|
from typing import ClassVar
|
||||||
|
|
||||||
|
|
||||||
def to_bool(string):
|
def to_bool(string):
|
||||||
@ -11,7 +12,7 @@ def to_bool(string):
|
|||||||
class Singleton(type):
|
class Singleton(type):
|
||||||
"""Meta singleton class."""
|
"""Meta singleton class."""
|
||||||
|
|
||||||
_instances = {}
|
_instances: ClassVar[dict] = {}
|
||||||
|
|
||||||
def __call__(cls, *args, **kwargs):
|
def __call__(cls, *args, **kwargs):
|
||||||
if cls not in cls._instances:
|
if cls not in cls._instances:
|
||||||
|
Loading…
Reference in New Issue
Block a user