From 2e052902062f6ddd5be49a02c9fbabac09a75d65 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 26 Jan 2016 14:45:55 -0700 Subject: [PATCH] Fixes issue with packet capture on VMware VMs. Fixes #396. --- gns3server/modules/vmware/vmware_vm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gns3server/modules/vmware/vmware_vm.py b/gns3server/modules/vmware/vmware_vm.py index 8385c534..8460a08a 100644 --- a/gns3server/modules/vmware/vmware_vm.py +++ b/gns3server/modules/vmware/vmware_vm.py @@ -375,6 +375,8 @@ class VMwareVM(BaseVM): vnet = "ethernet{}.vnet".format(adapter_number) if vnet not in self._vmx_pairs: raise VMwareError("vnet {} not in VMX file".format(vnet)) + if not self._ubridge_hypervisor: + raise VMwareError("Cannot start the packet capture: uBridge is not running") yield from self._ubridge_hypervisor.send('bridge start_capture {name} "{output_file}"'.format(name=vnet, output_file=output_file)) @@ -389,6 +391,8 @@ class VMwareVM(BaseVM): vnet = "ethernet{}.vnet".format(adapter_number) if vnet not in self._vmx_pairs: raise VMwareError("vnet {} not in VMX file".format(vnet)) + if not self._ubridge_hypervisor: + raise VMwareError("Cannot stop the packet capture: uBridge is not running") yield from self._ubridge_hypervisor.send("bridge stop_capture {name}".format(name=vnet)) def check_hw_virtualization(self):