Skip to content

Commit 35daa8c

Browse files
Itay4dantavoriyaakovicontent-botDctrG
authored
ParseEmailFiles - improved error handling in get_msg_type (#7712)
* add test for get_msg_mail_format with headers set to none * catch all types of exceptions raised in get_msg_format * New RN summary (#7133) * in progress * in progress * in progress * in progress * in progress * in progress * in progress * in progress * changed RN file name * added comments * test in progress * updated script * updated script * updated script * test fix helloworld * in progress * in progress * in progress * in progress * in progress * in progress * in progress * added test * fix * fixed doc * in progress * updated new release notes generator * in progress * in progress * in progress * in progress * fixed ignored release notes validations and added tests * small fixes * restored .gitignore * added new packs to release notes generator * fixed unit tests * fixed lint error * fixed lint error * fixed modified packs collection * Fixed handling of ignored section in RN files * fixed modified release notes filter * start merging pack versions block to single block * added support for merging pack versions block to single block * added unit test for merge release notes block function * fixed small formatting issue * fixed CR notes * fixed content-descriptor.json path * fixed time formats in content-descriptor.json Co-authored-by: syaakovi <[email protected]> * Microsoft azure feed (#7715) * Microsoft azure feed (#7410) * Add pack Azure AD Connect Health Feed * Clean up * Passed all tests * Fix test playbook * Minor fixes * Minor changes * remove changelog * change integration name global * include integration name in demisto.info * add docstring to substitution function * add disclaimer to readme * remove the other changelog * add command_examples.txt and generate readme with demisto-sdk * remove entries in tests/conf.json * remove urls from readme as it fails secrets test * remove trailing space * add entries back to conf.json as it fails pre-commit otherwise * remove exept blocks and apply suggestion to subs function * add suggested changes * Fix issue with results dict * changes to avoid duplicated indicators * remove substitution function as it's not deded Co-authored-by: Bar Katzir <[email protected]> * chnge taskid task.id TO UUIDS Co-authored-by: Guillermo Serrano <[email protected]> Co-authored-by: Bar Katzir <[email protected]> Co-authored-by: bar katzir <[email protected]> * Workday (#7478) * creating workday pack * Worker context build function * Integration Ready but README.md, fine-tuning on unitests and TPB * Added Unittests and README.md * * Removed "Business_Title" from headers * Changed `Phone Number` field source. (and changed expected context accordingly) * Changed Test_module output * Changed username and password params to credentials type. in Workday.yml * Changed TPB according to Shai's review in Workday_-_Test.yml * Added TPB details to conf.json Co-authored-by: Shai Yaakovi <[email protected]> * Update Packs/Workday/Integrations/Workday/Workday.py Co-authored-by: Shai Yaakovi <[email protected]> * Changed verion in README.md * CR Changes * Secrets * Updated * CR changes Added Workday TPB to skipped tests (lack of access) * Update docker image Co-authored-by: Shai Yaakovi <[email protected]> Co-authored-by: Alex Fiedler <[email protected]> * pan-os-edl-docs1 (#7510) * Revert base fix (#7717) * revert 1.0.11 and 1.0.12 versions in Base pack by issuing version 1.0.13 * skiping XDR iocs test (#7719) Co-authored-by: esharf <[email protected]> * Workday - rm TODO lines (#7720) * rm todo * SlackAsk readme - add missing arguments (#7650) * added missing arguments to the README. * docker * fix * Updated * correction * merge * RN * no RN Co-authored-by: Alex Fiedler <[email protected]> * fix typo in integration name (#7698) * bump version 20.6.1 (#7722) * PAN-OS - Added outputs to the `panorama-get-logs` command (#7554) * PAN-OS - Added outputs to the `panorama-get-logs` command * dockerimage update * Update Packs/PAN-OS/ReleaseNotes/1_1_0.md Co-authored-by: Andrew Shamah <[email protected]> Co-authored-by: Andrew Shamah <[email protected]> * Nightly parallel pack installation (#7693) * added multithreading to pack installation for nightly runs * fixed call error * fixed CR notes * added sleep after nightly pack installation * Update 1_1_10.md * CrowdStrike Falcon Streaming v2 - bug fixes and improvments (#7552) * disable session timeout, handle exception better, add log prints and store offset in context * bump docker image tag * output event dump to rawJSON * Updated * store sample events * fix mypy reports * remove unnecessary line from the readme * Update Packs/CrowdStrikeFalconStreamingV2/Integrations/CrowdStrikeFalconStreamingV2/CrowdStrikeFalconStreamingV2.yml Co-authored-by: Guy Lichtman <[email protected]> * Update Packs/CrowdStrikeFalconStreamingV2/Integrations/CrowdStrikeFalconStreamingV2/README.md Co-authored-by: Guy Lichtman <[email protected]> * Update Packs/CrowdStrikeFalconStreamingV2/Integrations/CrowdStrikeFalconStreamingV2/CrowdStrikeFalconStreamingV2.py Co-authored-by: Guy Lichtman <[email protected]> * Update Packs/CrowdStrikeFalconStreamingV2/Integrations/CrowdStrikeFalconStreamingV2/README.md Co-authored-by: Guy Lichtman <[email protected]> * update readme that events are fetched every 1 minute * store integration context every 1 min and check if param is enabled in get samples cmd * remove unused import of union * Updated * Updated * reset last_integration_context_set to now after context set Co-authored-by: Alex Fiedler <[email protected]> Co-authored-by: Guy Lichtman <[email protected]> * Flake8 phase15 (#7707) * Traps flake8 * MailSenderNew_test flake8 * comment rn * flake8 phase 13 (#7705) * ZScalar, PcapMinerV2, QuestKace, Zsacalar, DBotSuggestClassifierMapping, ExtractDomainFromUrlFormat_test flake8 fixes * base rns * fixed typo * fix rn * fix rn * fix metada * comment rn Co-authored-by: Dan Tavori <[email protected]> Co-authored-by: syaakovi <[email protected]> Co-authored-by: content-bot <[email protected]> Co-authored-by: Guillermo Serrano <[email protected]> Co-authored-by: Bar Katzir <[email protected]> Co-authored-by: bar katzir <[email protected]> Co-authored-by: Bargenish <[email protected]> Co-authored-by: Shai Yaakovi <[email protected]> Co-authored-by: Alex Fiedler <[email protected]> Co-authored-by: Andrew Shamah <[email protected]> Co-authored-by: eli sharf <[email protected]> Co-authored-by: esharf <[email protected]> Co-authored-by: Lior Blobstein <[email protected]> Co-authored-by: Bar Hochman <[email protected]> Co-authored-by: roysagi <[email protected]> Co-authored-by: Guy Lichtman <[email protected]>
1 parent 5c11b2a commit 35daa8c

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
#### Scripts
3+
##### ParseEmailFiles
4+
- Fixed an issue where errors were not handled as expected.

Packs/CommonScripts/Scripts/ParseEmailFiles/ParseEmailFiles.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3181,9 +3181,8 @@ def parse_email_headers(header, raw=False):
31813181
def get_msg_mail_format(msg_dict):
31823182
try:
31833183
return msg_dict.get('Headers', 'Content-type:').split('Content-type:')[1].split(';')[0]
3184-
except ValueError:
3185-
return ''
3186-
except IndexError:
3184+
except Exception as e:
3185+
demisto.debug('Got exception while trying to get msg mail format - {}'.format(str(e)))
31873186
return ''
31883187

31893188

Packs/CommonScripts/Scripts/ParseEmailFiles/parse_email_files_test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,20 @@ def test_no_content_type_file(mocker):
562562

563563

564564
def test_get_msg_mail_format():
565-
format = get_msg_mail_format({
565+
msg_mail_format = get_msg_mail_format({
566566
'Headers': 'Content-type:text/plain;'
567567
})
568-
assert format == 'text/plain'
568+
assert msg_mail_format == 'text/plain'
569569

570-
format = get_msg_mail_format({
570+
msg_mail_format = get_msg_mail_format({
571571
'Something': 'else'
572572
})
573-
assert format == ''
573+
assert msg_mail_format == ''
574+
575+
msg_mail_format = get_msg_mail_format({
576+
'Headers': None
577+
})
578+
assert msg_mail_format == ''
574579

575580

576581
def test_no_content_file(mocker):

Packs/CommonScripts/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Common Scripts",
33
"description": "Frequently used scripts pack.",
44
"support": "xsoar",
5-
"currentVersion": "1.1.9",
5+
"currentVersion": "1.1.10",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)