From a279bfe1d9d993e8f4658821c490fa24e5368959 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 26 Jan 2016 13:48:58 -0700 Subject: [PATCH] Fixes "can only use tap interfaces that both already exist and are up". Fixes #399. --- gns3server/modules/dynamips/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index dafd9c0c..a246c564 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -458,9 +458,10 @@ class Dynamips(BaseManager): nio = NIOLinuxEthernet(node.hypervisor, ethernet_device) elif nio_settings["type"] == "nio_tap": tap_device = nio_settings["tap_device"] - if not is_interface_up(tap_device): - raise aiohttp.web.HTTPConflict(text="TAP interface {} is down".format(tap_device)) nio = NIOTAP(node.hypervisor, tap_device) + if not is_interface_up(tap_device): + # test after the TAP interface has been created (if it doesn't exist yet) + raise aiohttp.web.HTTPConflict(text="TAP interface {} is down".format(tap_device)) elif nio_settings["type"] == "nio_unix": local_file = nio_settings["local_file"] remote_file = nio_settings["remote_file"]