From 9e4cfaf7879a527915cb44b73b20a8e544cd6aef Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 11 Sep 2017 13:02:26 +0700 Subject: [PATCH] Fix NAT node not working on Windows. Fixes #1163. --- gns3server/compute/builtin/nodes/nat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gns3server/compute/builtin/nodes/nat.py b/gns3server/compute/builtin/nodes/nat.py index a8919039..1d7557cd 100644 --- a/gns3server/compute/builtin/nodes/nat.py +++ b/gns3server/compute/builtin/nodes/nat.py @@ -36,11 +36,11 @@ class Nat(Cloud): raise NodeError("virbr0 is missing. You need to install libvirt") interface = "virbr0" else: - names = filter(lambda x: 'vmnet8' in x.lower(), - [interface["name"] for interface in gns3server.utils.interfaces.interfaces()]) - if not len(list(names)): + interfaces = list(filter(lambda x: 'vmnet8' in x.lower(), + [interface["name"] for interface in gns3server.utils.interfaces.interfaces()])) + if not len(interfaces): raise NodeError("vmnet8 is missing. You need to install VMware or use the NAT node on GNS3 VM") - interface = "vmnet8" + interface = interfaces[0] # take the first available interface containing the vmnet8 name ports = [ {