From 588088ca9323e5ea6226983d7206bb3e6a786815 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 24 Mar 2015 22:15:49 -0600 Subject: [PATCH] Fixes bug when remove_nio() is not a coroutine for ATM and FR switches. --- gns3server/handlers/api/dynamips_device_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/handlers/api/dynamips_device_handler.py b/gns3server/handlers/api/dynamips_device_handler.py index 3a6f8588..95307b89 100644 --- a/gns3server/handlers/api/dynamips_device_handler.py +++ b/gns3server/handlers/api/dynamips_device_handler.py @@ -181,7 +181,10 @@ class DynamipsDeviceHandler: dynamips_manager = Dynamips.instance() device = dynamips_manager.get_device(request.match_info["device_id"], project_id=request.match_info["project_id"]) port_number = int(request.match_info["port_number"]) - yield from device.remove_nio(port_number) + if asyncio.iscoroutinefunction(device.remove_nio): + yield from device.remove_nio(port_number) + else: + device.remove_nio(port_number) response.set_status(204) @Route.post(