]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
python: formatting improvements
authorAleš Mrázek <ales.mrazek@nic.cz>
Wed, 29 Jan 2025 09:47:05 +0000 (10:47 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Wed, 5 Feb 2025 22:05:19 +0000 (23:05 +0100)
python/knot_resolver/datamodel/config_schema.py
python/knot_resolver/datamodel/defer_schema.py
python/knot_resolver/datamodel/rate_limiting_schema.py
python/knot_resolver/datamodel/view_schema.py
python/knot_resolver/manager/manager.py

index 6329add3767956a485b45cf86fd10ce180762ce9..410e94d7c9c3520d4f577d77d5ec319ed72f83b6 100644 (file)
@@ -5,6 +5,7 @@ from typing import Any, Dict, List, Literal, Optional, Tuple, Union
 
 from knot_resolver.constants import API_SOCK_FILE, RUN_DIR, VERSION
 from knot_resolver.datamodel.cache_schema import CacheSchema
+from knot_resolver.datamodel.defer_schema import DeferSchema
 from knot_resolver.datamodel.dns64_schema import Dns64Schema
 from knot_resolver.datamodel.dnssec_schema import DnssecSchema
 from knot_resolver.datamodel.forward_schema import ForwardSchema
@@ -17,7 +18,6 @@ from knot_resolver.datamodel.monitoring_schema import MonitoringSchema
 from knot_resolver.datamodel.network_schema import NetworkSchema
 from knot_resolver.datamodel.options_schema import OptionsSchema
 from knot_resolver.datamodel.rate_limiting_schema import RateLimitingSchema
-from knot_resolver.datamodel.defer_schema import DeferSchema
 from knot_resolver.datamodel.templates import POLICY_CONFIG_TEMPLATE, WORKER_CONFIG_TEMPLATE
 from knot_resolver.datamodel.types import EscapedStr, IntPositive, WritableDir
 from knot_resolver.datamodel.view_schema import ViewSchema
index 38301e55fcd610bd905715de49ce5eb60eaacebc..81546a0756841e5a2671e7b2e47281763a3f8f83 100644 (file)
@@ -1,5 +1,5 @@
-from knot_resolver.utils.modeling import ConfigSchema
 from knot_resolver.datamodel.types import TimeUnit
+from knot_resolver.utils.modeling import ConfigSchema
 
 
 class DeferSchema(ConfigSchema):
index 60994c2068e59da370f416e1d22731d711de89d5..01771713c6c167a6a42c320e08223fb24c9e262c 100644 (file)
@@ -27,7 +27,7 @@ class RateLimitingSchema(ConfigSchema):
     dry_run: bool = False
 
     def _validate(self) -> None:
-        max_instant_limit = int(2 ** 32 // 768 - 1)
+        max_instant_limit = int(2**32 // 768 - 1)
         if not int(self.instant_limit) <= max_instant_limit:
             raise ValueError(f"'instant-limit' has to be in range 1..{max_instant_limit}")
         if not int(self.rate_limit) <= 1000 * int(self.instant_limit):
index 7afc042da2a38edee350e1653146a9f98bb36578..6d94b02af57420c7d40d24f87f9950cf852ce0ff 100644 (file)
@@ -1,7 +1,6 @@
 from typing import List, Literal, Optional
 
-from knot_resolver.datamodel.types import IDPattern, IPNetwork
-from knot_resolver.datamodel.types import FloatNonNegative
+from knot_resolver.datamodel.types import FloatNonNegative, IDPattern, IPNetwork
 from knot_resolver.utils.modeling import ConfigSchema
 
 
index 48d9a9ecf8f4fc83620ddf23b2224d0dfb011be8..c26d9561651274b7db02976dbd2551c67db545f7 100644 (file)
@@ -441,12 +441,12 @@ class KresManager:  # pylint: disable=too-many-instance-attributes
                 raise
             except BaseException:
                 invoke_callback = True
-                logger.error("Knot Resolver watchdog failed with an unexpected exception.", exc_info=True)
+                logger.error("Knot Resolver processes watchdog failed with an unexpected exception.", exc_info=True)
 
             if invoke_callback:
                 try:
                     await self._instability_handler()
                 except Exception:
-                    logger.error("Watchdog failed while invoking instability callback", exc_info=True)
+                    logger.error("Processes watchdog failed while invoking instability callback", exc_info=True)
                     logger.error("Violently terminating!")
                     sys.exit(1)