mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Fixes issue when loading a project using VMware vmnet interfaces. Fixes #319.
This commit is contained in:
parent
57bbd63085
commit
6e36687347
@ -348,9 +348,10 @@ class VMwareHandler:
|
||||
|
||||
@classmethod
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/vmware/interfaces/vmnet",
|
||||
r"/projects/{project_id}/vmware/vms/{vm_id}/interfaces/vmnet",
|
||||
parameters={
|
||||
"project_id": "The UUID of the project",
|
||||
"vm_id": "UUID for the instance",
|
||||
},
|
||||
status_codes={
|
||||
201: "VMnet interface allocated",
|
||||
@ -359,7 +360,9 @@ class VMwareHandler:
|
||||
def allocate_vmnet(request, response):
|
||||
|
||||
vmware_manager = VMware.instance()
|
||||
vm = vmware_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
|
||||
vmware_manager.refresh_vmnet_list(ubridge=False)
|
||||
vmnet = vmware_manager.allocate_vmnet()
|
||||
vm.vmnets.append(vmnet)
|
||||
response.set_status(201)
|
||||
response.json({"vmnet": vmnet})
|
||||
|
@ -820,7 +820,8 @@ class VMwareVM(BaseVM):
|
||||
raise VMwareError("Sorry, adding a link to a started VMware VM is not supported without uBridge enabled")
|
||||
self._vmx_pairs["ethernet{}.vnet".format(adapter_number)] = nio.vmnet
|
||||
self._write_vmx_file()
|
||||
self._vmnets.append(nio.vmnet)
|
||||
if nio.vmnet not in self._vmnets:
|
||||
self._vmnets.append(nio.vmnet)
|
||||
adapter.add_nio(0, nio)
|
||||
if self._started and self._use_ubridge:
|
||||
yield from self._add_ubridge_connection(nio, adapter_number)
|
||||
|
Loading…
Reference in New Issue
Block a user