From d0ed6931d8f43c34dd5be43aef2b869751d5bd2a Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 26 Jul 2018 13:34:23 -0500 Subject: [PATCH] Catch exception: ZIP does not support timestamps before 1980. Ref #1360. --- gns3server/controller/project.py | 2 +- gns3server/controller/udp_link.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index ece3d328..7d2ef53d 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -931,7 +931,7 @@ class Project: yield from wait_run_in_executor(self._create_duplicate_project_file, project_path, zipstream) with open(project_path, "rb") as f: project = yield from import_project(self._controller, str(uuid.uuid4()), f, location=location, name=name, keep_compute_id=True) - except (OSError, UnicodeEncodeError) as e: + except (ValueError, OSError, UnicodeEncodeError) as e: raise aiohttp.web.HTTPConflict(text="Can not duplicate project: {}".format(str(e))) if previous_status == "closed": diff --git a/gns3server/controller/udp_link.py b/gns3server/controller/udp_link.py index 479d66b5..018ed450 100644 --- a/gns3server/controller/udp_link.py +++ b/gns3server/controller/udp_link.py @@ -54,7 +54,7 @@ class UDPLink(Link): try: (node1_host, node2_host) = yield from node1.compute.get_ip_on_same_subnet(node2.compute) except ValueError as e: - raise aiohttp.web.HTTPConflict(text=str(e)) + raise aiohttp.web.HTTPConflict(text="Cannot get an IP address on same subnet: {}".format(e)) # Reserve a UDP port on both side response = yield from node1.compute.post("/projects/{}/ports/udp".format(self._project.id))