Skip to content

Commit

Permalink
Add a try/except around the user_details.all_with_home
Browse files Browse the repository at this point in the history
When something goes wrong when grabbing user details, it will be caught and acquire
can continue
  • Loading branch information
Miauwkeru committed Oct 16, 2023
1 parent d476709 commit b84b72f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ def misc_osx_user_homes(target: Target) -> Iterator[fsutil.TargetPath]:


def from_user_home(target: Target, path: str) -> Iterator[str]:
for user_details in target.user_details.all_with_home():
yield normalize_path(target, user_details.home_path.joinpath(path))
try:
for user_details in target.user_details.all_with_home():
yield normalize_path(target, user_details.home_path.joinpath(path))
except Exception:
log.warning("Error occured during when requesting all user homes.")

Check warning on line 150 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L146-L150

Added lines #L146 - L150 were not covered by tests

misc_user_homes = MISC_MAPPING.get(target.os, misc_unix_user_homes)
for user_dir in misc_user_homes(target):
Expand Down

0 comments on commit b84b72f

Please sign in to comment.