From c620d0be841d03a3b55fba90cf3e04ab0d32c809 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 5 Sep 2018 13:35:42 +0800 Subject: [PATCH] Improve the invalid port format detection. Fixes https://github.com/GNS3/gns3-gui/issues/2580 --- gns3server/controller/ports/port_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/controller/ports/port_factory.py b/gns3server/controller/ports/port_factory.py index 35d66b41..53d1d821 100644 --- a/gns3server/controller/ports/port_factory.py +++ b/gns3server/controller/ports/port_factory.py @@ -72,7 +72,7 @@ class StandardPortFactory: segment_number, adapter=adapter_number, **cls._generate_replacement(interface_number, segment_number)) - except (ValueError, KeyError) as e: + except (IndexError, ValueError, KeyError) as e: raise aiohttp.web.HTTPConflict(text="Invalid port name format {}: {}".format(port_name_format, str(e))) port = PortFactory(port_name, segment_number, adapter_number, port_number, "ethernet") interface_number += 1