Fixes bug when remove_nio() is not a coroutine for ATM and FR switches.

This commit is contained in:
grossmj 2015-03-24 22:15:49 -06:00
parent 07067d6765
commit 588088ca93

View File

@ -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(