mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-17 06:48:18 +00:00
A notification stream with process monitoring
This commit is contained in:
@ -48,6 +48,7 @@ class BaseVM:
|
||||
self._manager = manager
|
||||
self._console = console
|
||||
self._temporary_directory = None
|
||||
self._vm_status = "stopped"
|
||||
|
||||
if self._console is not None:
|
||||
self._console = self._manager.port_manager.reserve_tcp_port(self._console, self._project)
|
||||
@ -66,6 +67,18 @@ class BaseVM:
|
||||
if os.path.exists(self._temporary_directory):
|
||||
shutil.rmtree(self._temporary_directory, ignore_errors=True)
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""Return current VM status"""
|
||||
|
||||
return self._vm_status
|
||||
|
||||
@status.setter
|
||||
def status(self, status):
|
||||
|
||||
self._vm_status = status
|
||||
self._project.emit("vm.{}".format(status), self)
|
||||
|
||||
@property
|
||||
def project(self):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user