Skip to content
Snippets Groups Projects
Commit facf7646 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Ignore symlinks in 'buildFileList()' method.

parent fa03e04b
No related branches found
No related tags found
No related merge requests found
Pipeline #5771 passed
......@@ -129,13 +129,13 @@ class RetrieveExecutor(TaskExecutor):
srcPath = nodeInfo["fullPath"]
username = nodeInfo["username"]
md5calc = Checksum()
if os.path.isdir(srcPath):
if os.path.isdir(srcPath) and not os.path.islink(srcPath):
for root, dirs, files in os.walk(srcPath, topdown = False):
dirSize = os.stat(root).st_size
self.totalSize += dirSize
for f in files:
fullPath = os.path.join(root, f)
if md5calc.fileIsValid(fullPath):
if md5calc.fileIsValid(fullPath) and not os.path.islink(fullPath):
fileSize = os.stat(fullPath).st_size
fileInfo = {
"baseSrcPath": baseSrcPath,
......@@ -147,7 +147,7 @@ class RetrieveExecutor(TaskExecutor):
self.totalSize += fileSize
self.fileList.append(fileInfo.copy())
else:
if md5calc.fileIsValid(srcPath):
if md5calc.fileIsValid(srcPath) and not os.path.islink(srcPath):
fileSize = nodeInfo["contentLength"]
fileInfo = {
"baseSrcPath": baseSrcPath,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment