]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
Don't fail when source removed from index.
authorJason Ish <jason.ish@oisf.net>
Thu, 14 Apr 2022 15:54:30 +0000 (09:54 -0600)
committerJason Ish <jason.ish@oisf.net>
Thu, 14 Apr 2022 15:56:36 +0000 (09:56 -0600)
Instead of failing when an enabled source is no longer in the index, log
an error and continue onto the next source.

Ticket 5269

suricata/update/main.py

index 2e0909cccf91c0b46825b7beacdfcef243e7d930..98c876b5265404a276c4e37ea574b384d0e336f2 100644 (file)
@@ -936,6 +936,9 @@ def load_sources(suricata_version):
                         "Source index is required for source %s; "
                         "run suricata-update update-sources" % (source["source"]))
                 source_config = index.get_source_by_name(name)
+                if source_config is None:
+                    logger.warn("Source no longer exists in index and will not be fetched: {}".format(name))
+                    continue
                 try:
                     checksum = source_config["checksum"]
                 except: