diff --git a/src/python/jw/pkg/cmds/secrets/lib/DistroContext.py b/src/python/jw/pkg/cmds/secrets/lib/DistroContext.py index ea2ce814..1e6ede82 100644 --- a/src/python/jw/pkg/cmds/secrets/lib/DistroContext.py +++ b/src/python/jw/pkg/cmds/secrets/lib/DistroContext.py @@ -40,7 +40,7 @@ class DistroContext(FilesContext): ret = [] for tmpl in await self.list_template_files(packages): path = str(Path(tmpl).with_suffix(".jw-secret")) - if ignore_missing and not self.ctx.file_exists(path): + if ignore_missing and not await self.ctx.file_exists(path): continue ret.append(path) return ret @@ -49,7 +49,7 @@ class DistroContext(FilesContext): ret = [] for tmpl in await self.list_template_files(packages): path = tmpl.removesuffix('.jw-tmpl') - if ignore_missing and not self.ctx.file_exists(path): + if ignore_missing and not await self.ctx.file_exists(path): continue ret.append(path) return ret diff --git a/src/python/jw/pkg/lib/FileContext.py b/src/python/jw/pkg/lib/FileContext.py index 33720770..df6034e1 100644 --- a/src/python/jw/pkg/lib/FileContext.py +++ b/src/python/jw/pkg/lib/FileContext.py @@ -157,7 +157,7 @@ class FileContext(abc.ABC): async def _file_exists(self, path: str) -> bool: try: - self._stat(path, False) + await self._stat(path, False) except FileNotFoundError as e: log(DEBUG, f'Could not stat file {path} ({str(e)}), ignored') return False @@ -167,7 +167,7 @@ class FileContext(abc.ABC): return True async def file_exists(self, path: str) -> bool: - return self._file_exists(path) + return await self._file_exists(path) async def _is_dir(self, path: str) -> bool: try: