|
42 | 42 | 'v322_url_replacement', |
43 | 43 | 'v322_removed_feeds_and_bots', |
44 | 44 | 'v340_deprecations', |
45 | | - 'v350_feed_removals', |
| 45 | + 'v350_blueliv_removal', |
46 | 46 | 'v350_new_fields', |
47 | 47 | ] |
48 | 48 |
|
@@ -976,37 +976,27 @@ def v340_deprecations(configuration, harmonization, dry_run, **kwargs): |
976 | 976 | return message or changed, configuration, harmonization |
977 | 977 |
|
978 | 978 |
|
979 | | -def v350_feed_removals(configuration, harmonization, dry_run, **kwargs): |
| 979 | +def v350_blueliv_removal(configuration, harmonization, dry_run, **kwargs): |
980 | 980 | """ |
981 | 981 | Remove blueliv collector and parser |
982 | 982 | """ |
983 | | - messages = [] |
| 983 | + message = None |
984 | 984 | discontinued_bots = [] |
985 | 985 | discontinued_bots_modules = ( |
986 | 986 | "intelmq.bots.collectors.blueliv.collector_crimeserver", |
987 | 987 | "intelmq.bots.parsers.blueliv.parser_crimeserver", |
988 | 988 | ) |
989 | | - discontinued_feeds = [] |
990 | 989 |
|
991 | 990 | for bot_id, bot in configuration.items(): |
992 | 991 | if bot_id == 'global': |
993 | 992 | continue |
994 | 993 | if bot["module"] in discontinued_bots_modules: |
995 | 994 | discontinued_bots.append(bot_id) |
996 | | - elif bot["module"] == "intelmq.bots.collectors.http.collector_http": |
997 | | - if bot["parameters"].get("http_url", "") == 'https://tracker.viriback.com/dump.php': |
998 | | - discontinued_feeds.append(bot_id) |
999 | | - |
1000 | | - if discontinued_feeds: |
1001 | | - messages.append(f"Found discontinued feeds collected by bots: {', '.join(discontinued_feeds)}") |
1002 | 995 |
|
1003 | 996 | if discontinued_bots: |
1004 | | - messages.append(f"Found discontinued bots: {', '.join(discontinued_bots)}.") |
1005 | | - |
1006 | | - if messages: |
1007 | | - messages.append("Remove the affected bots from the configuration.") |
| 997 | + message = f"Found discontinued bots: {', '.join(discontinued_bots)}. Remove the affected bots from the configuration." |
1008 | 998 |
|
1009 | | - return '\n'.join(messages) if messages else None, configuration, harmonization |
| 999 | + return message, configuration, harmonization |
1010 | 1000 |
|
1011 | 1001 |
|
1012 | 1002 | def v350_new_fields(configuration, harmonization, dry_run, **kwargs): |
@@ -1068,7 +1058,7 @@ def v350_new_fields(configuration, harmonization, dry_run, **kwargs): |
1068 | 1058 | ((3, 3, 0), ()), |
1069 | 1059 | ((3, 3, 1), ()), |
1070 | 1060 | ((3, 4, 0), (v340_deprecations, )), |
1071 | | - ((3, 5, 0), (v350_feed_removals, v350_new_fields)), |
| 1061 | + ((3, 5, 0), (v350_blueliv_removal, v350_new_fields)), |
1072 | 1062 | ]) |
1073 | 1063 |
|
1074 | 1064 | ALWAYS = (harmonization,) |
0 commit comments