Skip to content

Commit cdcf05a

Browse files
committed
fix
1 parent 6458203 commit cdcf05a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openwisp_controller/config/tasks_zerotier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def handle_api_call(self, fn, *args, send_notification=True, **kwargs):
6262
if send_notification:
6363
handle_recovery_notification(task_key, **kwargs)
6464
except RequestException as e:
65-
if e.response and e.response.status_code in self._RECOVERABLE_API_CODES:
65+
if response.status_code in self._RECOVERABLE_API_CODES:
6666
retry_logger = logger.warning
6767
# When retry limit is reached, use error logging
6868
if self.request.retries == self.max_retries:
@@ -75,7 +75,7 @@ def handle_api_call(self, fn, *args, send_notification=True, **kwargs):
7575
logger.error(f"{err_msg}, Error: {e}")
7676
if send_notification:
7777
handle_error_notification(task_key, exception=e, **kwargs)
78-
return (response, updated_config) if updated_config else response
78+
return (response, updated_config) if updated_config else response
7979

8080

8181
@shared_task(

0 commit comments

Comments
 (0)