]> git.ipfire.org Git - dbl.git/commitdiff
exporters: Don't fail if exporting for the first time master
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Mar 2026 16:23:49 +0000 (16:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Mar 2026 16:23:49 +0000 (16:23 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dbl/exporters.py

index 6af66cac8ca8872292b818011ac4f73f22189110..76e6ac640a365e96992871225cd1d0ab7809065a 100644 (file)
@@ -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: