Skip to content

Commit 3501beb

Browse files
authored
Merge branch 'main' into exception-handling
2 parents 6d46363 + 0d0fca4 commit 3501beb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cs3client/file.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def touch_file(self, auth_token: tuple, resource: Resource) -> None:
170170

171171
def write_file(
172172
self, auth_token: tuple, resource: Resource, content: Union[str, bytes], size: int,
173-
app_name: Optional[str] = None, lock_id: Optional[str] = None
173+
app_name: Optional[str] = None, lock_id: Optional[str] = None,
174+
disable_versioning: bool = False
174175
) -> None:
175176
"""
176177
Write a file using the given userid as access token. The entire content is written
@@ -184,6 +185,7 @@ def write_file(
184185
:param size: size of content (optional)
185186
:param app_name: application name (optional)
186187
:param lock_id: lock id (optional)
188+
:param disable_versioning: bool to disable versioning on EOS (optional)
187189
:return: None (Success)
188190
:raises: FileLockedException (File is locked),
189191
:raises: AuthenticationException (Authentication failed)
@@ -229,6 +231,8 @@ def write_file(
229231
"X-Lock-Id": lock_id,
230232
"X-Lock-Holder": app_name,
231233
}
234+
if disable_versioning:
235+
headers.update({"X-Disable-Versioning": "true"})
232236
putres = requests.put(
233237
url=protocol.upload_endpoint,
234238
data=content,

0 commit comments

Comments
 (0)