From 418e7cc7f9edbfb10234ec88b474d352547e7618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 27 Sep 2018 16:34:49 -0400 Subject: [PATCH] fix: properly match main type --- bgpranking/shadowserverfetcher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bgpranking/shadowserverfetcher.py b/bgpranking/shadowserverfetcher.py index 043b80a..9fe0c99 100644 --- a/bgpranking/shadowserverfetcher.py +++ b/bgpranking/shadowserverfetcher.py @@ -89,7 +89,10 @@ class ShadowServerFetcher(): prefix = type_content.split('.')[0] config['name'] = '{}-{}'.format(prefix, '_'.join(type_details)) - main_type = type_details[0] + if isinstance(type_details, str): + main_type = type_details + else: + main_type = type_details[0] if main_type not in self.known_list_types: self.logger.warning(f'Unknown type: {main_type}. Please update the config creator script.') return None