Change the copy_archives method to use copy2 73/63173/3
authorEric Ball <eball@linuxfoundation.org>
Sat, 22 Feb 2020 03:15:32 +0000 (19:15 -0800)
committerEric Ball <eball@linuxfoundation.org>
Tue, 25 Feb 2020 18:10:37 +0000 (10:10 -0800)
commit3fad9329a6de8384446fb63215311d29e8aab363
treea23db9c25dde1753c984d13a48ac695f174024ba
parent914ad805709bc409348784bbbbc5060131dfefe3
Change the copy_archives method to use copy2

Uses copy2 with follow_symlinks set to False, which will copy
symlinks as symlinks, rather than following their path. Since glob
does not have an option to not follow symlinks, we instead just check
for file existence to ignore issues with globbing symlinked paths
that "open" fails to find.

Issue: RELENG-2576
Change-Id: Ie5a6ffba5c1cb79cff7dd9c691d9b9bd2eaeeba3
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
lftools/deploy.py
releasenotes/notes/fix-archive-symlink-loops-0e754059d8db33ba.yaml [new file with mode: 0644]
tests/fixtures/deploy/workspace-symlinks/archives/child/parent [new symlink]
tests/fixtures/deploy/workspace-symlinks/archives/non-existent-file [new symlink]
tests/fixtures/deploy/workspace-symlinks/archives/test.log [new file with mode: 0644]
tests/test_deploy.py