mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-11 15:32:39 +00:00
Fix AttributeError: 'NIONAT' object has no attribute 'lport' for
VirtualBox Fix #205
This commit is contained in:
parent
a2e51ac090
commit
57f9d875ca
@ -805,12 +805,16 @@ class VirtualBoxVM(BaseVM):
|
|||||||
|
|
||||||
vm_state = yield from self._get_vm_state()
|
vm_state = yield from self._get_vm_state()
|
||||||
if vm_state == "running":
|
if vm_state == "running":
|
||||||
|
if isinstance(nio, NIOUDP):
|
||||||
# dynamically configure an UDP tunnel on the VirtualBox adapter
|
# dynamically configure an UDP tunnel on the VirtualBox adapter
|
||||||
yield from self._control_vm("nic{} generic UDPTunnel".format(adapter_number + 1))
|
yield from self._control_vm("nic{} generic UDPTunnel".format(adapter_number + 1))
|
||||||
yield from self._control_vm("nicproperty{} sport={}".format(adapter_number + 1, nio.lport))
|
yield from self._control_vm("nicproperty{} sport={}".format(adapter_number + 1, nio.lport))
|
||||||
yield from self._control_vm("nicproperty{} dest={}".format(adapter_number + 1, nio.rhost))
|
yield from self._control_vm("nicproperty{} dest={}".format(adapter_number + 1, nio.rhost))
|
||||||
yield from self._control_vm("nicproperty{} dport={}".format(adapter_number + 1, nio.rport))
|
yield from self._control_vm("nicproperty{} dport={}".format(adapter_number + 1, nio.rport))
|
||||||
yield from self._control_vm("setlinkstate{} on".format(adapter_number + 1))
|
yield from self._control_vm("setlinkstate{} on".format(adapter_number + 1))
|
||||||
|
elif isinstance(nio, NIONAT):
|
||||||
|
yield from self._modify_vm("--nic{} nat".format(adapter_number + 1))
|
||||||
|
yield from self._modify_vm("--cableconnected{} on".format(adapter_number + 1))
|
||||||
|
|
||||||
adapter.add_nio(0, nio)
|
adapter.add_nio(0, nio)
|
||||||
log.info("VirtualBox VM '{name}' [{id}]: {nio} added to adapter {adapter_number}".format(name=self.name,
|
log.info("VirtualBox VM '{name}' [{id}]: {nio} added to adapter {adapter_number}".format(name=self.name,
|
||||||
|
Loading…
Reference in New Issue
Block a user