From 3be2700d8e72fb8a32dfe612a271585d0bde567e Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Mon, 1 Jul 2024 16:36:32 +0200 Subject: [PATCH] Last code tidy ups --- apps/greencheck/importers/importer_cloudflare.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/greencheck/importers/importer_cloudflare.py b/apps/greencheck/importers/importer_cloudflare.py index 19e82466..e78de82d 100644 --- a/apps/greencheck/importers/importer_cloudflare.py +++ b/apps/greencheck/importers/importer_cloudflare.py @@ -51,12 +51,13 @@ def parse_to_list(self, raw_data: list[str]) -> List[Union[str, Tuple]]: if not line: continue - # (i.e. ip with subnet + # only return AS networks and IP networks if line.startswith("AS") or line[0].isdigit(): list_of_ips.append(line) return list_of_ips - except Exception: - logger.exception("Something really unexpected happened. Aborting") + except Exception as err: + logger.warning("Unexpected error raised") + logger.warning(err) assert isinstance(CloudflareImporter(), ImporterProtocol)