Skip to content

Commit

Permalink
Merge branch 'main' into exception-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern authored Oct 22, 2024
2 parents 6d46363 + 0d0fca4 commit 3501beb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cs3client/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def touch_file(self, auth_token: tuple, resource: Resource) -> None:

def write_file(
self, auth_token: tuple, resource: Resource, content: Union[str, bytes], size: int,
app_name: Optional[str] = None, lock_id: Optional[str] = None
app_name: Optional[str] = None, lock_id: Optional[str] = None,
disable_versioning: bool = False
) -> None:
"""
Write a file using the given userid as access token. The entire content is written
Expand All @@ -184,6 +185,7 @@ def write_file(
:param size: size of content (optional)
:param app_name: application name (optional)
:param lock_id: lock id (optional)
:param disable_versioning: bool to disable versioning on EOS (optional)
:return: None (Success)
:raises: FileLockedException (File is locked),
:raises: AuthenticationException (Authentication failed)
Expand Down Expand Up @@ -229,6 +231,8 @@ def write_file(
"X-Lock-Id": lock_id,
"X-Lock-Holder": app_name,
}
if disable_versioning:
headers.update({"X-Disable-Versioning": "true"})
putres = requests.put(
url=protocol.upload_endpoint,
data=content,
Expand Down

0 comments on commit 3501beb

Please sign in to comment.