Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demisto/python3-deb:3.11.10.112166 | 0-100 | PR batch #1/1 #36488

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
10 changes: 5 additions & 5 deletions Packs/ArcherRSA/Integrations/ArcherV2/ArcherV2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from datetime import timezone
from datetime import UTC, datetime
import random

import dateparser
Expand Down Expand Up @@ -74,7 +74,7 @@ def parser(
assert isinstance(
date_obj, datetime
), f"Could not parse date {date_str}" # MYPY Fix
return date_obj.replace(tzinfo=timezone.utc)
return date_obj.replace(tzinfo=UTC)


def get_token_soap_request(user, password, instance, domain=None):
Expand Down Expand Up @@ -1708,14 +1708,14 @@ def fetch_incidents(
# Build incidents
incidents = []
# Encountered that sometimes, somehow, on of next_fetch is not UTC.
last_fetch_time = from_time.replace(tzinfo=timezone.utc)
last_fetch_time = from_time.replace(tzinfo=UTC)
next_fetch = last_fetch_time
for record in records:
incident, incident_created_time = client.record_to_incident(
record, app_id, fetch_param_id
)
# Encountered that sometimes, somehow, incident_created_time is not UTC.
incident_created_time = incident_created_time.replace(tzinfo=timezone.utc)
incident_created_time = incident_created_time.replace(tzinfo=UTC)
if last_fetch_time < incident_created_time:
incidents.append(incident)
if next_fetch < incident_created_time:
Expand Down Expand Up @@ -1743,7 +1743,7 @@ def get_fetch_time(last_fetch: dict, first_fetch_time: str) -> datetime:
start_fetch = parser(next_run)
else:
start_fetch, _ = parse_date_range(first_fetch_time)
start_fetch.replace(tzinfo=timezone.utc)
start_fetch.replace(tzinfo=UTC)
return start_fetch


Expand Down
2 changes: 1 addition & 1 deletion Packs/ArcherRSA/Integrations/ArcherV2/ArcherV2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ script:
- arguments: []
description: Prints the Archer's integration cache.
name: archer-print-cache
dockerimage: demisto/python3-deb:3.10.14.93258
dockerimage: demisto/python3-deb:3.11.10.112166
isfetch: true
script: ''
subtype: python3
Expand Down
18 changes: 9 additions & 9 deletions Packs/ArcherRSA/Integrations/ArcherV2/ArcherV2_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import copy
from datetime import datetime, timezone
from datetime import datetime, UTC
import pytest
from CommonServerPython import DemistoException
import demistomock as demisto
Expand Down Expand Up @@ -561,7 +561,7 @@ def test_record_to_incident(self):
record = copy.deepcopy(INCIDENT_RECORD)
record['raw']['Field'][1]['@xmlConvertedValue'] = '2018-03-26T10:03:00Z'
incident, incident_created_time = client.record_to_incident(record, 75, '305')
assert incident_created_time == datetime(2018, 3, 26, 10, 3, tzinfo=timezone.utc)
assert incident_created_time == datetime(2018, 3, 26, 10, 3, tzinfo=UTC)
assert incident['name'] == 'RSA Archer Incident: 227602'
assert incident['occurred'] == '2018-03-26T10:03:00Z'

Expand Down Expand Up @@ -778,7 +778,7 @@ def test_record_to_incident_europe_time(self):
incident['raw']['Field'][1]['@xmlConvertedValue'] = '2018-03-26T10:03:00Z'
incident['record']['Date/Time Reported'] = "26/03/2018 10:03 AM"
incident, incident_created_time = client.record_to_incident(INCIDENT_RECORD, 75, '305')
assert incident_created_time == datetime(2018, 3, 26, 10, 3, tzinfo=timezone.utc)
assert incident_created_time == datetime(2018, 3, 26, 10, 3, tzinfo=UTC)
assert incident['occurred'] == '2018-03-26T10:03:00Z'

def test_record_to_incident_american_time(self):
Expand All @@ -800,7 +800,7 @@ def test_record_to_incident_american_time(self):
incident, incident_created_time = client.record_to_incident(
INCIDENT_RECORD, 75, '305'
)
assert incident_created_time == datetime(2018, 3, 26, 10, 3, tzinfo=timezone.utc)
assert incident_created_time == datetime(2018, 3, 26, 10, 3, tzinfo=UTC)
assert incident['occurred'] == '2018-03-26T10:03:00Z'

def test_fetch_time_change(self, mocker):
Expand Down Expand Up @@ -832,7 +832,7 @@ def test_fetch_time_change(self, mocker):
mocker.patch.object(client, 'search_records', return_value=([record], {}))
incidents, next_fetch = fetch_incidents(client, params, last_fetch, '305')
assert last_fetch < next_fetch
assert next_fetch == datetime(2018, 4, 3, 10, 3, tzinfo=timezone.utc)
assert next_fetch == datetime(2018, 4, 3, 10, 3, tzinfo=UTC)
assert incidents[0]['occurred'] == date_time_reported

def test_two_fetches(self, mocker):
Expand Down Expand Up @@ -867,11 +867,11 @@ def test_two_fetches(self, mocker):
)
incidents, next_fetch = fetch_incidents(client, params, last_fetch, '305')
assert last_fetch < next_fetch
assert next_fetch == datetime(2020, 3, 18, 10, 30, tzinfo=timezone.utc)
assert next_fetch == datetime(2020, 3, 18, 10, 30, tzinfo=UTC)
assert incidents[0]['occurred'] == '2020-03-18T10:30:00.000Z'
incidents, next_fetch = fetch_incidents(client, params, next_fetch, '305')
assert last_fetch < next_fetch
assert next_fetch == datetime(2020, 3, 18, 15, 30, tzinfo=timezone.utc)
assert next_fetch == datetime(2020, 3, 18, 15, 30, tzinfo=UTC)
assert incidents[0]['occurred'] == '2020-03-18T15:30:00.000Z'

def test_fetch_got_old_incident(self, mocker):
Expand Down Expand Up @@ -958,12 +958,12 @@ def test_same_record_returned_in_two_fetches(self, mocker):
first_fetch = parser('2021-02-24T08:45:55Z')
incidents, first_next_fetch = fetch_incidents(client, params, first_fetch, field_time_id)
assert first_fetch < first_next_fetch
assert first_next_fetch == datetime(2021, 2, 25, 8, 45, 55, 977000, tzinfo=timezone.utc)
assert first_next_fetch == datetime(2021, 2, 25, 8, 45, 55, 977000, tzinfo=UTC)
assert incidents[0]['occurred'] == '2021-02-25T08:45:55.977Z'
# first_next_fetch_dt simulates the set to last_run done in fetch-incidents
first_next_fetch_dt = parser(first_next_fetch.strftime(OCCURRED_FORMAT))
incidents, second_next_fetch = fetch_incidents(client, params, first_next_fetch_dt, field_time_id)
assert first_next_fetch == datetime(2021, 2, 25, 8, 45, 55, 977000, tzinfo=timezone.utc)
assert first_next_fetch == datetime(2021, 2, 25, 8, 45, 55, 977000, tzinfo=UTC)
assert not incidents

def test_search_records_by_report_command(self, mocker):
Expand Down
2 changes: 1 addition & 1 deletion Packs/CommonScripts/Scripts/JsonUnescape/JsonUnescape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3-deb:3.10.13.85666
dockerimage: demisto/python3-deb:3.11.10.112166
enabled: true
name: JsonUnescape
outputs:
Expand Down
8 changes: 8 additions & 0 deletions Tests/docker_native_image_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,15 @@
"ignored_native_images":[
"native:8.6"
]
},
{
"id": "RSA Archer v2",
"reason": "CIAC-11186, This integration support only from python 3.11",
"ignored_native_images": [
"native:8.6"
]
}

],
"flags_versions_mapping": {
"native:dev": "native:dev",
Expand Down
Loading