Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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: