Skip to content

Commit

Permalink
Collect setting in posix file source plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Nov 9, 2024
1 parent d28e4f9 commit 1628a75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/galaxy/files/sources/posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(self, **kwd: Unpack[PosixFilesSourceProperties]):
self.root = props.get("root")
if not self.root:
self.writable = False
self.link_only = props.get("link_only", False)
self.enforce_symlink_security = props.get("enforce_symlink_security", DEFAULT_ENFORCE_SYMLINK_SECURITY)
self.delete_on_realize = props.get("delete_on_realize", DEFAULT_DELETE_ON_REALIZE)
self.allow_subdir_creation = props.get("allow_subdir_creation", DEFAULT_ALLOW_SUBDIR_CREATION)
Expand Down Expand Up @@ -102,8 +103,9 @@ def _realize_to(
else:
source_native_path = os.path.normpath(source_native_path)
assert source_native_path.startswith(os.path.normpath(effective_root))

if not self.delete_on_realize:
if self.link_only:
os.symlink(source_native_path, native_path)
elif not self.delete_on_realize:
shutil.copyfile(source_native_path, native_path)
else:
shutil.move(source_native_path, native_path)
Expand Down

0 comments on commit 1628a75

Please sign in to comment.