Skip to content

Commit

Permalink
Apply comment suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Giuseppe Lo Presti <giuseppe.lopresti@cern.ch>
  • Loading branch information
aduffeck and glpatcern committed Jan 18, 2024
1 parent 8472c83 commit f00a43e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/cs3iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ def writefile(endpoint, filepath, userid, content, lockmd, islock=False):
log.warning(f'msg="Access denied uploading file to Reva" reason="{putres.reason}"')
raise IOError(common.ACCESS_ERROR)
if putres.status_code != http.client.OK:
if len(content) == 0: # 0-byte file uploads are finalized after the InitiateFileUploadRequest request already
if len(content) == 0: # 0-byte file uploads may have been finalized after the InitiateFileUploadRequest request already, let's assume it's OK
# TODO this use-case is to be reimplemented with a call to `TouchFile`.
log.info('msg="0-byte file written successfully" filepath="%s" elapsedTimems="%.1f" islock="%s"' %
(filepath, (tend - tstart) * 1000, islock))
return
Expand Down

0 comments on commit f00a43e

Please sign in to comment.