From e8e587b92e425e3f69ede70657b0490ed1d0e425 Mon Sep 17 00:00:00 2001 From: Content Bot Date: Wed, 19 Jun 2024 13:56:43 +0000 Subject: [PATCH 1/5] CrowdStrikeFalcon: apply UP015 --- .../Scripts/ReadNetstatFile/ReadNetstatFile.py | 2 +- .../Scripts/ReadProcessesFile/ReadProcessesFile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py b/Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py index 933cb13bc7fe..e0b8ba034c0f 100644 --- a/Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py +++ b/Packs/CrowdStrikeFalcon/Scripts/ReadNetstatFile/ReadNetstatFile.py @@ -46,7 +46,7 @@ def get_file_content(file_entry_id): if file_entry_id: res = execute_command('getFilePath', {'id': file_entry_id}) file_path = res.get('path') - with open(file_path, 'r') as f: + with open(file_path) as f: file_content = f.read() return file_content diff --git a/Packs/CrowdStrikeFalcon/Scripts/ReadProcessesFile/ReadProcessesFile.py b/Packs/CrowdStrikeFalcon/Scripts/ReadProcessesFile/ReadProcessesFile.py index 3b3ae6a1e734..1250f0fa798a 100644 --- a/Packs/CrowdStrikeFalcon/Scripts/ReadProcessesFile/ReadProcessesFile.py +++ b/Packs/CrowdStrikeFalcon/Scripts/ReadProcessesFile/ReadProcessesFile.py @@ -46,7 +46,7 @@ def get_file_content(file_entry_id): if file_entry_id: res = execute_command('getFilePath', {'id': file_entry_id}) file_path = res.get('path') - with open(file_path, 'r') as f: + with open(file_path) as f: file_content = f.read() return file_content From b3dea2a1bfbd5001d73c3d3c3ae0f4256f2cd732 Mon Sep 17 00:00:00 2001 From: Content Bot Date: Wed, 19 Jun 2024 13:56:45 +0000 Subject: [PATCH 2/5] DemistoRESTAPI: apply UP015 --- .../Scripts/GetTasksWithSections/GetTasksWithSections_test.py | 2 +- .../SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py b/Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py index 20be138abc24..eeea624bdf37 100644 --- a/Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py +++ b/Packs/DemistoRESTAPI/Scripts/GetTasksWithSections/GetTasksWithSections_test.py @@ -3,7 +3,7 @@ def load_json(file): - with open(file, 'r') as f: + with open(file) as f: return json.load(f) diff --git a/Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py b/Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py index bfc7a1cd1044..0e609d3b0cb2 100644 --- a/Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py +++ b/Packs/DemistoRESTAPI/Scripts/SetIRProceduresMarkdown/SetIRProceduresMarkdown_test.py @@ -3,7 +3,7 @@ def load_json(file): - with open(file, 'r') as f: + with open(file) as f: return json.load(f) From 082658a5080a1157db194ad42700d39367472c29 Mon Sep 17 00:00:00 2001 From: Content Bot Date: Wed, 19 Jun 2024 13:56:47 +0000 Subject: [PATCH 3/5] DuoAdminApi: apply UP015 --- .../Integrations/DuoEventCollector/DuoEventCollector_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector_test.py b/Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector_test.py index 1ee8b3960be6..fde09ec0a4a0 100644 --- a/Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector_test.py +++ b/Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector_test.py @@ -43,7 +43,7 @@ def ret_fresh_parameters(): def load_json(file: str) -> dict: - with open(file, 'r') as f: + with open(file) as f: return json.load(f) From 3cc12d1ab620554e7d74263d1dba38edc7fba9ac Mon Sep 17 00:00:00 2001 From: Content Bot Date: Wed, 19 Jun 2024 13:56:50 +0000 Subject: [PATCH 4/5] EmailCommunication: apply UP015 --- .../SummarizeEmailThreads/SummarizeEmailThreads_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packs/EmailCommunication/Scripts/SummarizeEmailThreads/SummarizeEmailThreads_test.py b/Packs/EmailCommunication/Scripts/SummarizeEmailThreads/SummarizeEmailThreads_test.py index 56c8081ab1ab..509f8993330b 100644 --- a/Packs/EmailCommunication/Scripts/SummarizeEmailThreads/SummarizeEmailThreads_test.py +++ b/Packs/EmailCommunication/Scripts/SummarizeEmailThreads/SummarizeEmailThreads_test.py @@ -3,12 +3,12 @@ def util_open_file(path): - with open(path, mode='r') as f: + with open(path) as f: return f.read() def util_load_json(path): - with open(path, mode='r') as f: + with open(path) as f: return json.loads(f.read()) From 251bcd8c3e3f5ce88d95da8b805d164be1e197cf Mon Sep 17 00:00:00 2001 From: Content Bot Date: Wed, 19 Jun 2024 13:56:52 +0000 Subject: [PATCH 5/5] FeedAzureADConnectHealth: apply UP015 --- .../AzureADConnectHealthFeed/AzureADConnectHealthFeed_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/FeedAzureADConnectHealth/Integrations/AzureADConnectHealthFeed/AzureADConnectHealthFeed_test.py b/Packs/FeedAzureADConnectHealth/Integrations/AzureADConnectHealthFeed/AzureADConnectHealthFeed_test.py index 635fa5fd0f28..6877d0b054c0 100644 --- a/Packs/FeedAzureADConnectHealth/Integrations/AzureADConnectHealthFeed/AzureADConnectHealthFeed_test.py +++ b/Packs/FeedAzureADConnectHealth/Integrations/AzureADConnectHealthFeed/AzureADConnectHealthFeed_test.py @@ -5,7 +5,7 @@ def test_build_iterator(requests_mock): - with open('test_data/Microsoft_endpoint_mock.html', 'r') as file: + with open('test_data/Microsoft_endpoint_mock.html') as file: response = file.read() requests_mock.get(URL, text=response) expected_url = 'https://login.microsoftonline.com'