From: Michael Tremer Date: Thu, 19 Mar 2026 16:23:49 +0000 (+0000) Subject: exporters: Don't fail if exporting for the first time X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4eb1e02cfafec2b5ed36edaeff09d4da16d8532f;p=dbl.git exporters: Don't fail if exporting for the first time Signed-off-by: Michael Tremer --- diff --git a/src/dbl/exporters.py b/src/dbl/exporters.py index 6af66ca..76e6ac6 100644 --- a/src/dbl/exporters.py +++ b/src/dbl/exporters.py @@ -705,9 +705,15 @@ class DirectoryExporter(MultiExporter): path = self._make_path(name, **kwargs) # Skip the export if we don't need it - if not force and os.path.getmtime(path) >= exporter.exported_at.timestamp(): - log.debug("Skipping export because the file seems to be recent enough") - return + if not force: + try: + if os.path.getmtime(path) >= exporter.exported_at.timestamp(): + log.debug("Skipping export because the file seems to be recent enough") + return + + # Ignore if the file does not exist, yet + except FileNotFoundError: + pass # Ensure the parent directory exists try: