]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
nit: datamodel: fix formatting docs-release-6-0-gxcp82/deployments/7233
authorAleš Mrázek <ales.mrazek@nic.cz>
Thu, 17 Jul 2025 07:48:59 +0000 (09:48 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Thu, 17 Jul 2025 09:07:44 +0000 (11:07 +0200)
python/knot_resolver/datamodel/local_data_schema.py
python/knot_resolver/datamodel/types/files.py

index 782142ed2b305dfec92efcdf9c963ac3ea854179..12a59301e3f0394cccbae2473aafbd2eb85afedc 100644 (file)
@@ -71,7 +71,7 @@ class RPZSchema(ConfigSchema):
         watchdog: Union[Literal["auto"], bool] = "auto"
         tags: Optional[List[IDPattern]] = None
         log: Optional[List[Literal["ip", "name"]]] = None
-        #dry_run: bool = False
+        # dry_run: bool = False
 
     _LAYER = Raw
 
@@ -79,7 +79,7 @@ class RPZSchema(ConfigSchema):
     watchdog: bool
     tags: Optional[List[IDPattern]]
     log: Optional[List[Literal["ip", "name"]]]
-    #dry_run: bool
+    # dry_run: bool
 
     def _watchdog(self, obj: Raw) -> Any:
         if obj.watchdog == "auto":
index b19237fa2554b1487672de24bb6835cd0e6118f1..1e7cea04077d28043037441b09864fd388e9d59b 100644 (file)
@@ -160,6 +160,7 @@ class _PermissionMode(Flag):
     WRITE = auto()
     EXECUTE = auto()
 
+
 def _check_permission(dest_path: Path, perm_mode: _PermissionMode) -> bool:
     chflags = {
         _PermissionMode.READ: [stat.S_IRUSR, stat.S_IRGRP, stat.S_IROTH],
@@ -262,9 +263,7 @@ class WritableFilePath(FilePath):
                 logger.info(f"{msg}, but the resolver can somehow (ACLs, ...) write to the directory")
 
             # check that existing file is writable
-            if self._value.exists() and not _check_permission(
-                self._value, _PermissionMode.WRITE
-            ):
+            if self._value.exists() and not _check_permission(self._value, _PermissionMode.WRITE):
                 msg = f"{USER}:{GROUP} has insufficient permissions to write/execute '{self._value}'"
                 if not os.access(self._value, os.W_OK):
                     raise ValueError(msg)