]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
Better URL fail message on with --fail.
authorJason Ish <jason.ish@oisf.net>
Fri, 15 Apr 2022 15:24:58 +0000 (09:24 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 15 Apr 2022 15:34:11 +0000 (09:34 -0600)
If --fail, we wil not use the cached version.

suricata/update/main.py

index 9b2b177cf1e467cf51e3cc577693be5961c7f755..a0dd880451e309523ae81bd9f5d01563bf79521b 100644 (file)
@@ -198,10 +198,10 @@ class Fetch:
             tmp_fileobj.close()
         except URLError as err:
             if os.path.exists(tmp_filename):
-                msg = "Failed to fetch {}, will use latest cached version: {}".format(url, err)
-                if conf.args().fail:
-                    strict_error(msg)
-                logger.warning(msg)
+                if config.args().fail:
+                    strict_error("Failed to fetch {}: {}".format(url, err))
+                else:
+                    logger.error("Failed to fetch {}, will use latest cached version: {}".format(url, err))
                 return self.extract_files(tmp_filename)
             raise err
         except IOError as err: