Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ def updateBundles(self):
Path(os.path.commonpath(paths)).parent if len(paths) == 1 else Path(os.path.commonpath(paths))
)
gLogger.info(f"Bundle will have {len(filesToBundle)} files with common path {commonParent}")

def _makeWritable(tarinfo):
# Ensure files are extracted as writable so subsequent syncs can overwrite them.
# by setting the owner-write bit (0o200)
tarinfo.mode |= 0o200
return tarinfo

with tarfile.open("dummy", "w:gz", buffer_) as tarBuffer:
for p in paths:
tarBuffer.add(str(p), str(p.relative_to(commonParent)))
tarBuffer.add(str(p), str(p.relative_to(commonParent)), filter=_makeWritable)
zippedData = buffer_.getvalue()
buffer_.close()
hash_ = File.getMD5ForFiles(filesToBundle)
Expand Down
Loading