|
11 | 11 | import jwt |
12 | 12 | import re |
13 | 13 | from distutils.util import strtobool |
14 | | -from datetime import timezone |
| 14 | +from datetime import UTC |
15 | 15 | from typing import Any, Dict, Tuple, List, Optional, BinaryIO |
16 | 16 | from requests.models import Response |
17 | 17 | from hashlib import sha1 |
@@ -1935,7 +1935,7 @@ def test_module(client: Client, params: dict, first_fetch_time: int) -> str: |
1935 | 1935 | if not params.get('as_user'): |
1936 | 1936 | raise DemistoException("In order to use fetch, a User ID for Fetching Incidents is " |
1937 | 1937 | "required.") |
1938 | | - created_after = datetime.fromtimestamp(first_fetch_time, tz=timezone.utc).strftime( |
| 1938 | + created_after = datetime.fromtimestamp(first_fetch_time, tz=UTC).strftime( |
1939 | 1939 | DATE_FORMAT) |
1940 | 1940 | response = client.list_events( |
1941 | 1941 | as_user=params.get('as_user'), # type:ignore |
@@ -1965,12 +1965,12 @@ def fetch_incidents(client: Client, max_results: int, last_run: dict, first_fetc |
1965 | 1965 | created_after = last_run.get('time', None) |
1966 | 1966 | incidents = [] |
1967 | 1967 | if not created_after: |
1968 | | - created_after = datetime.fromtimestamp(first_fetch_time, tz=timezone.utc).strftime( |
| 1968 | + created_after = datetime.fromtimestamp(first_fetch_time, tz=UTC).strftime( |
1969 | 1969 | DATE_FORMAT) |
1970 | 1970 | results = client.list_events(stream_type='admin_logs', as_user=as_user, limit=max_results, |
1971 | 1971 | created_after=created_after) |
1972 | 1972 | raw_incidents = results.get('entries', []) |
1973 | | - next_run = datetime.now(tz=timezone.utc).strftime(DATE_FORMAT) |
| 1973 | + next_run = datetime.now(tz=UTC).strftime(DATE_FORMAT) |
1974 | 1974 | for raw_incident in raw_incidents: |
1975 | 1975 | event = Event(raw_input=raw_incident) |
1976 | 1976 | xsoar_incident = event.format_incident() |
|
0 commit comments