mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 09:00:57 +00:00
Fix Can't remove a slot from dynamips device
Fix https://github.com/GNS3/gns3-gui/issues/1510
This commit is contained in:
parent
b8909c54cf
commit
f06c00fdb8
@ -520,7 +520,7 @@ class Dynamips(BaseManager):
|
|||||||
yield from vm.slot_add_binding(slot_id, adapter)
|
yield from vm.slot_add_binding(slot_id, adapter)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise DynamipsError("Slot {} doesn't exist on this router".format(slot_id))
|
raise DynamipsError("Slot {} doesn't exist on this router".format(slot_id))
|
||||||
elif name.startswith("slot") and value is None:
|
elif name.startswith("slot") and (value is None or value is ""):
|
||||||
slot_id = int(name[-1])
|
slot_id = int(name[-1])
|
||||||
try:
|
try:
|
||||||
if vm.slots[slot_id]:
|
if vm.slots[slot_id]:
|
||||||
@ -538,7 +538,7 @@ class Dynamips(BaseManager):
|
|||||||
yield from vm.install_wic(wic_slot_id, wic)
|
yield from vm.install_wic(wic_slot_id, wic)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise DynamipsError("WIC slot {} doesn't exist on this router".format(wic_slot_id))
|
raise DynamipsError("WIC slot {} doesn't exist on this router".format(wic_slot_id))
|
||||||
elif name.startswith("wic") and value is None:
|
elif name.startswith("wic") and (value is None or value is ""):
|
||||||
wic_slot_id = int(name[-1])
|
wic_slot_id = int(name[-1])
|
||||||
try:
|
try:
|
||||||
if vm.slots[0].wics and vm.slots[0].wics[wic_slot_id]:
|
if vm.slots[0].wics and vm.slots[0].wics[wic_slot_id]:
|
||||||
|
Loading…
Reference in New Issue
Block a user