From e497e98ca1f9fbaa58d6f6cf4a64d8374a3f486d Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 27 May 2016 14:45:02 +0200 Subject: [PATCH] Warn if you can not export a file due to permission issue Fix #543 --- gns3server/modules/project.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gns3server/modules/project.py b/gns3server/modules/project.py index d659a8cb..eeee6c0a 100644 --- a/gns3server/modules/project.py +++ b/gns3server/modules/project.py @@ -538,6 +538,14 @@ class Project: for file in files: path = os.path.join(root, file) + # Try open the file + try: + open(path).close() + except OSError as e: + msg = "Could not export file {}: {}".format(path, e) + log.warn(msg) + self.emit("log.warning", {"message": msg}) + continue # We rename the .gns3 project.gns3 to avoid the task to the client to guess the file name if file.endswith(".gns3"): self._export_project_file(path, z, include_images)