1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 00:08:11 +00:00

Fix error when missing adapter

Fix #112
This commit is contained in:
Julien Duponchelle 2015-03-27 16:20:31 +01:00
parent 4a0879f2d1
commit 3c917c59fb

View File

@ -1181,6 +1181,11 @@ class Router(BaseVM):
except IndexError:
raise DynamipsError('Slot {slot_number} does not exist on router "{name}"'.format(name=self._name,
slot_number=slot_number))
if adapter is None:
raise DynamipsError("Adapter is missing in {slot_number}".format( slot_number=slot_number))
if not adapter.port_exists(port_number):
raise DynamipsError("Port {port_number} does not exist in adapter {adapter}".format(adapter=adapter,
port_number=port_number))
@ -1215,6 +1220,9 @@ class Router(BaseVM):
except IndexError:
raise DynamipsError('Slot {slot_number} does not exist on router "{name}"'.format(name=self._name,
slot_number=slot_number))
if not adapter.port_exists(port_number):
raise DynamipsError("Port {port_number} does not exist in adapter {adapter}".format(adapter=adapter,
port_number=port_number))