From 37f4ff2f63093c7ef6d98e3a723af62ecfeed267 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 8 Jul 2015 13:00:54 -0600 Subject: [PATCH 1/3] Do not monitor the ubridge process because it creates an issue on Windows. --- gns3server/modules/vmware/vmware_vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/modules/vmware/vmware_vm.py b/gns3server/modules/vmware/vmware_vm.py index 9ec44610..ee887e52 100644 --- a/gns3server/modules/vmware/vmware_vm.py +++ b/gns3server/modules/vmware/vmware_vm.py @@ -347,7 +347,7 @@ class VMwareVM(BaseVM): stderr=subprocess.STDOUT, cwd=self.working_dir) - monitor_process(self._ubridge_process, self._termination_callback) + #monitor_process(self._ubridge_process, self._termination_callback) log.info("ubridge started PID={}".format(self._ubridge_process.pid)) except (OSError, subprocess.SubprocessError) as e: ubridge_stdout = self.read_ubridge_stdout() From 870029123c499ce150f0b5a198680ca2262b9698 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 8 Jul 2015 14:51:21 -0600 Subject: [PATCH 2/3] Netifaces is not used on Windows. Fixes #257. --- gns3server/utils/interfaces.py | 10 ++++++---- setup.py | 14 ++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gns3server/utils/interfaces.py b/gns3server/utils/interfaces.py index e8597cc8..f0145341 100644 --- a/gns3server/utils/interfaces.py +++ b/gns3server/utils/interfaces.py @@ -20,7 +20,6 @@ import sys import aiohttp import socket import struct -import netifaces import logging log = logging.getLogger(__name__) @@ -115,10 +114,12 @@ def is_interface_up(interface): :returns: boolean """ - if interface not in netifaces.interfaces(): - return False - if sys.platform.startswith("linux"): + + import netifaces + if interface not in netifaces.interfaces(): + return False + import fcntl SIOCGIFFLAGS = 0x8913 try: @@ -144,6 +145,7 @@ def interfaces(): results = [] if not sys.platform.startswith("win"): + import netifaces for interface in netifaces.interfaces(): ip_address = "" ip_addresses = netifaces.ifaddresses(interface) diff --git a/setup.py b/setup.py index b0f8379b..a41e309b 100644 --- a/setup.py +++ b/setup.py @@ -45,12 +45,14 @@ dependencies = [ "raven>=5.2.0" ] -try: - import netifaces -except ImportError: - # add gns3-netifaces only if netifaces isn't already installed - # for instance via a Debian package. - dependencies.append("gns3-netifaces>=0.10.4.1") +if not sys.platform.startswith("win"): + # netifaces if not used on Windows + try: + import netifaces + except ImportError: + # add gns3-netifaces only if netifaces isn't already installed + # for instance via a Debian package. + dependencies.append("gns3-netifaces>=0.10.4.1") setup( name="gns3-server", From 32e0d49e1e8ffe90172ab298ec2f36d9b01d69ae Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 8 Jul 2015 17:48:34 -0600 Subject: [PATCH 3/3] VMware VMs always have a working directory (to store the ubrige.ini and ubrige.log files). --- gns3server/modules/vmware/vmware_vm.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gns3server/modules/vmware/vmware_vm.py b/gns3server/modules/vmware/vmware_vm.py index ee887e52..15602f06 100644 --- a/gns3server/modules/vmware/vmware_vm.py +++ b/gns3server/modules/vmware/vmware_vm.py @@ -93,11 +93,8 @@ class VMwareVM(BaseVM): "enable_remote_console": self.enable_remote_console, "adapters": self._adapters, "adapter_type": self.adapter_type, - "use_any_adapter": self.use_any_adapter} - if self._linked_clone: - json["vm_directory"] = self.working_dir - else: - json["vm_directory"] = None + "use_any_adapter": self.use_any_adapter, + "vm_directory": self.working_dir} return json @property