Skip to content

Commit 3f1d8f8

Browse files
Fix ConfigManagingActor crash if any path in config_paths doesn't exist
`event.path.samefile(p)` raises error if: * event.path doesn't exists * path `p` doesn't exists This PR checks if `p` exists before calling this method. Signed-off-by: Elzbieta Kotulska <[email protected]>
1 parent f80c831 commit 3f1d8f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/frequenz/sdk/config/_config_managing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ async def _run(self) -> None:
176176
# Since we are watching the whole parent directories, we need to make
177177
# sure we only react to events related to the configuration files we
178178
# are interested in.
179-
if not any(event.path.samefile(p) for p in self._config_paths):
179+
if not any(
180+
event.path.samefile(p) for p in self._config_paths if p.exists()
181+
):
180182
continue
181183

182184
match event.type:

0 commit comments

Comments
 (0)