From 2510e4cedbeb3f18dcf9f4cf2d63811ed45d0c46 Mon Sep 17 00:00:00 2001 From: Israel Lappe <79846863+ilappe@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:54:05 +0200 Subject: [PATCH] fix + RN (#32990) --- Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.py | 6 ++---- .../ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.yml | 2 +- Packs/ServiceNow/ReleaseNotes/2_5_54.md | 7 +++++++ Packs/ServiceNow/pack_metadata.json | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 Packs/ServiceNow/ReleaseNotes/2_5_54.md diff --git a/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.py b/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.py index e16f4af02853..dade0ad6689d 100644 --- a/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.py +++ b/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.py @@ -1,7 +1,6 @@ import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 import re -import shutil from collections.abc import Callable, Iterable @@ -709,8 +708,8 @@ def send_request(self, path: str, method: str = 'GET', body: dict | None = None, try: file_entry = file['id'] file_name = file['name'] - shutil.copy(demisto.getFilePath(file_entry)['path'], file_name) - with open(file_name, 'rb') as f: + file_path = demisto.getFilePath(file_entry)['path'] + with open(file_path, 'rb') as f: file_info = (file_name, f, self.get_content_type(file_name)) if self.use_oauth: access_token = self.snow_client.get_access_token() @@ -723,7 +722,6 @@ def send_request(self, path: str, method: str = 'GET', body: dict | None = None, res = requests.request(method, url, headers=headers, data=body, params=params, files={'file': file_info}, auth=self._auth, verify=self._verify, proxies=self._proxies) - shutil.rmtree(demisto.getFilePath(file_entry)['name'], ignore_errors=True) except Exception as err: raise Exception('Failed to upload file - ' + str(err)) else: diff --git a/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.yml b/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.yml index aea11526c403..203187ff0d66 100644 --- a/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.yml +++ b/Packs/ServiceNow/Integrations/ServiceNowv2/ServiceNowv2.yml @@ -1610,7 +1610,7 @@ script: - contextPath: ServiceNow.Generic.Response description: Generic response to servicenow api. type: string - dockerimage: demisto/python3:3.10.13.86272 + dockerimage: demisto/python3:3.10.13.87159 isfetch: true ismappable: true isremotesyncin: true diff --git a/Packs/ServiceNow/ReleaseNotes/2_5_54.md b/Packs/ServiceNow/ReleaseNotes/2_5_54.md new file mode 100644 index 000000000000..4e3fd141b79d --- /dev/null +++ b/Packs/ServiceNow/ReleaseNotes/2_5_54.md @@ -0,0 +1,7 @@ + +#### Integrations + +##### ServiceNow v2 + +- Fixed an issue where the ***servicenow-upload-file*** command failed in case the file name contained invalid characters. +- Updated the Docker image to: *demisto/python3:3.10.13.87159*. \ No newline at end of file diff --git a/Packs/ServiceNow/pack_metadata.json b/Packs/ServiceNow/pack_metadata.json index 24af09c0df5f..876ef3d88ae7 100644 --- a/Packs/ServiceNow/pack_metadata.json +++ b/Packs/ServiceNow/pack_metadata.json @@ -2,7 +2,7 @@ "name": "ServiceNow", "description": "Use The ServiceNow IT Service Management (ITSM) solution to modernize the way you manage and deliver services to your users.", "support": "xsoar", - "currentVersion": "2.5.53", + "currentVersion": "2.5.54", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",