From 86d236f859c8d6065d078853d512eb243927fddc Mon Sep 17 00:00:00 2001 From: Sebdraven Date: Thu, 12 Jul 2018 14:47:34 +0200 Subject: [PATCH] add status_ok to true --- misp_modules/modules/expansion/securitytrails.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/misp_modules/modules/expansion/securitytrails.py b/misp_modules/modules/expansion/securitytrails.py index 68a7206..8395c13 100644 --- a/misp_modules/modules/expansion/securitytrails.py +++ b/misp_modules/modules/expansion/securitytrails.py @@ -128,8 +128,12 @@ def handle_domain(api, domain, misperrors): if status_ok: if r: - print(r) + result_filtered['results'].extend(r) + else: + misperrors['error'] = misperrors['error'] + \ + ' Error in expand History Whois' + return result_filtered @@ -395,7 +399,7 @@ def expand_history_whois(api, domain): if 'items' in results['result']: for item in results['result']['items']: item_registrant = __select_registrant_item(item) - print(item_registrant) + r.extend( { 'type': ['domain'], @@ -436,7 +440,7 @@ def expand_history_whois(api, domain): except APIError as e: misperrors['error'] = e return [], False - + status_ok = True return r, status_ok @@ -507,9 +511,7 @@ def __select_registrant_item(entry): entry['contacts'])) if 'contact' in entry: - print(entry) - print('\r\n') res = list(filter(lambda x: x['type'] == 'registrant', entry['contact'])) - print(res) + return res