Refactor aux port allocation

This move the allocation of aux port to the base vm.
Also now the free of console port during the close is in the
base VM.

An aux port is allocated to the docker container but not used
for the moment.

Ref https://github.com/GNS3/gns3-gui/issues/1039
This commit is contained in:
Julien Duponchelle committed 2016-02-29 10:44:08 +01:00
1 parent c333e9451f
commit 9d28f4c0c3
12 files changed
+190 -132

No files matched your search

+2 -11
View File
@@ -542,14 +542,8 @@ class VMwareVM(BaseVM):
Closes this VMware VM.
"""
if self._closed:
# VM is already closed
return
log.debug("VMware VM '{name}' [{id}] is closing".format(name=self.name, id=self.id))
if self._console:
self._manager.port_manager.release_tcp_port(self._console, self._project)
self._console = None
if not (yield from super().close()):
return False
for adapter in self._ethernet_adapters.values():
if adapter is not None:
@@ -567,9 +561,6 @@ class VMwareVM(BaseVM):
if self._linked_clone:
yield from self.manager.remove_from_vmware_inventory(self._vmx_path)
log.info("VirtualBox VM '{name}' [{id}] closed".format(name=self.name, id=self.id))
self._closed = True
@property
def headless(self):
"""