From: Aleš Mrázek Date: Mon, 18 Sep 2023 22:35:10 +0000 (+0200) Subject: datamodel: types: FilePath strict validation fix X-Git-Tag: v6.0.3~1^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=729282bc00bd5f2557403fbd66667743a84e3957;p=thirdparty%2Fknot-resolver.git datamodel: types: FilePath strict validation fix --- diff --git a/manager/knot_resolver_manager/datamodel/types/files.py b/manager/knot_resolver_manager/datamodel/types/files.py index 6244a6d37..dd5163587 100644 --- a/manager/knot_resolver_manager/datamodel/types/files.py +++ b/manager/knot_resolver_manager/datamodel/types/files.py @@ -132,7 +132,7 @@ class FilePath(UncheckedPath): ) -> None: super().__init__(source_value, parents=parents, object_path=object_path) p = self._value.parent - if self.strict_validation and not p.exists() or not p.is_dir(): + if self.strict_validation and (not p.exists() or not p.is_dir()): raise ValueError(f"path '{self._value}' does not point inside an existing directory") if self.strict_validation and self._value.is_dir(): raise ValueError(f"path '{self._value}' points to a directory when we expected a file")