From 78e1272d23b0dfd1f94df269adf8454f6a88aa8e Mon Sep 17 00:00:00 2001 From: eli sharf <57587340+esharf@users.noreply.github.com> Date: Tue, 2 May 2023 17:03:13 +0300 Subject: [PATCH] fix splunk 404 error msg (#26228) * fixed error message * update docker image * update RN --- Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.py | 6 ++++-- Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.yml | 2 +- Packs/SplunkPy/ReleaseNotes/3_0_16.md | 7 +++++++ Packs/SplunkPy/pack_metadata.json | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 Packs/SplunkPy/ReleaseNotes/3_0_16.md diff --git a/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.py b/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.py index 4a1d82c96f5b..a033de9f7dfd 100644 --- a/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.py +++ b/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.py @@ -700,6 +700,7 @@ class Cache: not_yet_submitted_notables (list): The list of all notables that were fetched but not yet submitted. submitted_notables (list): The list of all submitted notables that needs to be handled. """ + def __init__(self, not_yet_submitted_notables=None, submitted_notables=None): self.not_yet_submitted_notables = not_yet_submitted_notables if not_yet_submitted_notables else [] self.submitted_notables = submitted_notables if submitted_notables else [] @@ -2146,10 +2147,11 @@ def splunk_results_command(service: client.Service): try: job = service.job(sid) except HTTPError as error: - if error.message == 'HTTP 404 Not Found -- Unknown sid.': # pylint: disable=no-member + msg = error.message if hasattr(error, 'message') else str(error) + if error.status == 404: demisto.results("Found no job for sid: {}".format(sid)) else: - return_error(error.message, error) # pylint: disable=no-member + return_error(msg, error) else: for result in results.ResultsReader(job.results(count=limit)): if isinstance(result, results.Message): diff --git a/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.yml b/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.yml index 6d8c9c74179a..eee678a4bde7 100644 --- a/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.yml +++ b/Packs/SplunkPy/Integrations/SplunkPy/SplunkPy.yml @@ -628,7 +628,7 @@ script: - contextPath: Splunk.UserMapping.SplunkUser description: Splunk user mapping. type: String - dockerimage: demisto/splunksdk-py3:1.0.0.54635 + dockerimage: demisto/splunksdk-py3:1.0.0.56501 isfetch: true ismappable: true isremotesyncin: true diff --git a/Packs/SplunkPy/ReleaseNotes/3_0_16.md b/Packs/SplunkPy/ReleaseNotes/3_0_16.md new file mode 100644 index 000000000000..e75edc2bbeba --- /dev/null +++ b/Packs/SplunkPy/ReleaseNotes/3_0_16.md @@ -0,0 +1,7 @@ + +#### Integrations + +##### SplunkPy + +- Fixed error message for invalid job ids for command *splunk-results*. +- Updated the Docker image to: *demisto/splunksdk-py3:1.0.0.56501*. diff --git a/Packs/SplunkPy/pack_metadata.json b/Packs/SplunkPy/pack_metadata.json index 19c80f892494..18474e615238 100644 --- a/Packs/SplunkPy/pack_metadata.json +++ b/Packs/SplunkPy/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Splunk", "description": "Run queries on Splunk servers.", "support": "xsoar", - "currentVersion": "3.0.15", + "currentVersion": "3.0.16", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",