Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v26.16.2

- Some requests calls were missed from the retry logic. Ensured that all calls are retried.

## v26.16.1

- Add exponential backoff for MS Graph API calls
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "otf-addons-o365"
version = "v26.16.1"
version = "v26.16.2"
authors = [{ name = "Adam McDonagh", email = "adam@elitemonkey.net" }]
license = { text = "GPLv3" }
classifiers = [
Expand Down Expand Up @@ -46,7 +46,7 @@ dev = [
profile = 'black'

[tool.bumpver]
current_version = "v26.16.1"
current_version = "v26.16.2"
version_pattern = "vYY.WW.PATCH[-TAG]"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
Expand Down
19 changes: 14 additions & 5 deletions src/opentaskpy/addons/o365/remotehandlers/sharepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def _request(self, method: str, url: str, **kwargs: Any) -> requests.Response:
return requests.post(url, **kwargs) # pylint: disable=missing-timeout
if method_upper == "PUT":
return requests.put(url, **kwargs) # pylint: disable=missing-timeout
if method_upper == "PATCH":
return requests.patch(url, **kwargs) # pylint: disable=missing-timeout
if method_upper == "DELETE":
return requests.delete(url, **kwargs) # pylint: disable=missing-timeout
raise ValueError(f"Unsupported HTTP method for retry wrapper: {method}")

def __init__(self, spec: dict):
Expand Down Expand Up @@ -230,7 +234,8 @@ def handle_post_copy_action(self, files: dict) -> int:
if not file_url:
self.logger.error(f"Failed to get file URL for {file_path}")
return 1
response = requests.delete(
response = self._request(
"DELETE",
file_url,
headers={
"Authorization": "Bearer " + self.credentials["access_token"],
Expand Down Expand Up @@ -284,7 +289,8 @@ def handle_post_copy_action(self, files: dict) -> int:
"Authorization": "Bearer " + self.credentials["access_token"],
"Content-Type": "application/json",
}
response = requests.patch(
response = self._request(
"PATCH",
file_url,
headers=patch_headers,
timeout=self.timeout,
Expand All @@ -303,7 +309,8 @@ def handle_post_copy_action(self, files: dict) -> int:
f"Failed to get file URL for {destination_path}/{new_file}"
)
return 1
response = requests.delete(
response = self._request(
"DELETE",
conflict_url,
headers={
"Authorization": (
Expand All @@ -321,7 +328,8 @@ def handle_post_copy_action(self, files: dict) -> int:
self.logger.error(response.json())
return 1

response = requests.patch(
response = self._request(
"PATCH",
file_url,
headers=patch_headers,
timeout=self.timeout,
Expand Down Expand Up @@ -540,7 +548,8 @@ def push_files_from_worker(
retry_delay = 1

for attempt in range(max_retries):
response = requests.put(
response = self._request(
"PUT",
upload_url,
headers={
"Authorization": (
Expand Down
Loading