Skip to content

Commit

Permalink
flatten
Browse files Browse the repository at this point in the history
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
ben-alkov committed Dec 6, 2024
1 parent e6abe76 commit e204ac4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions osbs/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,15 @@ def _enforce_sandbox(repo_root: str, *, remove_unsafe_symlinks: bool) -> None:

for entry in subdirs + files:
# apparently pylint doesn't understand Path
# pylint: disable-next=old-division
full_path = dirpath / entry
full_path = dirpath / entry # pylint: disable=old-division

try:
real_path = full_path.resolve()
# the logic here actually *requires* f-strings with `!r`. using
# `%r` DOES NOT WORK (tested)
# pylint: disable-next=logging-fstring-interpolation
except RuntimeError as e:
if "Symlink loop from " in str(e):
logger.info(f"Symlink loop from {full_path!r}")
logger.info(f"Symlink loop from {full_path!r}") # pylint: disable=logging-fstring-interpolation
continue
logger.exception("RuntimeError encountered")
raise
Expand All @@ -105,9 +103,9 @@ def _enforce_sandbox(repo_root: str, *, remove_unsafe_symlinks: bool) -> None:
if remove_unsafe_symlinks:
full_path.unlink()
logger.warning(
# pylint: disable-next=logging-fstring-interpolation
f"The destination of {relative_path!r} is outside of cloned repository. "
"Removing..." )
f"The destination of {relative_path!r} is outside of cloned repository. " # pylint: disable=logging-fstring-interpolation
"Removing..."
)
else:
raise OsbsValidationException(
f"The destination of {relative_path!r} is outside of cloned repository",
Expand Down

0 comments on commit e204ac4

Please sign in to comment.