Merge remote-tracking branch 'origin/unstable' into unstable

This commit is contained in:
grossmj committed 2015-05-14 20:12:08 -06:00
commit 0ac27c40da
13 files changed
+108 -42

No files matched your search

+6 -4
View File
@@ -535,17 +535,19 @@ class Dynamips(BaseManager):
default_private_config_path = os.path.join(module_workdir, "configs", "i{}_private-config.cfg".format(vm.dynamips_id))
startup_config_path = settings.get("startup_config")
startup_config_content = settings.get("startup_config_content")
if startup_config_path:
yield from vm.set_configs(startup_config_path)
else:
startup_config_path = self._create_config(vm, default_startup_config_path, settings.get("startup_config_content"))
elif startup_config_content:
startup_config_path = self._create_config(vm, default_startup_config_path, startup_config_content)
yield from vm.set_configs(startup_config_path)
private_config_path = settings.get("private_config")
private_config_content = settings.get("private_config_content")
if private_config_path:
yield from vm.set_configs(vm.startup_config, private_config_path)
else:
private_config_path = self._create_config(vm, default_private_config_path, settings.get("private_config_content"))
elif private_config_content:
private_config_path = self._create_config(vm, default_private_config_path, private_config_content)
yield from vm.set_configs(vm.startup_config, private_config_path)
def _create_config(self, vm, path, content=None):
+3 -1
View File
@@ -259,11 +259,13 @@ class Router(BaseVM):
@asyncio.coroutine
def _termination_callback(self, returncode):
"""
Called when the process is killed
Called when the process has stopped.
:param returncode: Process returncode
"""
self.status = "stopped"
log.info("Dynamips hypervisor process has stopped, return code: %d", returncode)
@asyncio.coroutine
def stop(self):
+9 -5
View File
@@ -433,11 +433,14 @@ class IOUVM(BaseVM):
yield from self._library_check()
self._rename_nvram_file()
try:
self._rename_nvram_file()
except OSError as e:
raise IOUError("Could not rename nvram files: {}".format(e))
iourc_path = self.iourc_path
if iourc_path is None:
raise IOUError("Could not find a iourc file (IOU license)")
if not iourc_path:
raise IOUError("Could not find an iourc file (IOU license)")
if not os.path.isfile(iourc_path):
raise IOUError("The iourc path '{}' is not a regular file".format(iourc_path))
@@ -481,11 +484,12 @@ class IOUVM(BaseVM):
def _termination_callback(self, returncode):
"""
Called when the process is killed
Called when the process has stopped.
:param returncode: Process returncode
"""
log.info("IOU process crash return code: %d", returncode)
log.info("IOU process has stopped, return code: %d", returncode)
self._terminate_process_iou()
self._terminate_process_iouyap()
self._ioucon_thread_stop_event.set()
+4 -4
View File
@@ -65,7 +65,7 @@ class Project:
self._used_tcp_ports = set()
self._used_udp_ports = set()
# List of clients listen for notifications
# clients listening for notifications
self._listeners = set()
if path is None:
@@ -437,10 +437,10 @@ class Project:
def emit(self, action, event):
"""
Send an event to all the client listens for notifications
Send an event to all the client listening for notifications
:param action: Action happened
:param event: Event sended to the client
:param action: Action name
:param event: Event to send
"""
for listener in self._listeners:
listener.put_nowait((action, event, ))
+3 -2
View File
@@ -596,12 +596,13 @@ class QemuVM(BaseVM):
def _termination_callback(self, returncode):
"""
Called when the process is killed
Called when the process has stopped.
:param returncode: Process returncode
"""
if self.started:
log.info("Process Qemu is dead. Return code: %d", returncode)
log.info("QEMU process has stopped, return code: %d", returncode)
self.status = "stopped"
self._process = None
+2 -2
View File
@@ -245,12 +245,12 @@ class VPCSVM(BaseVM):
def _termination_callback(self, returncode):
"""
Called when the process is killed
Called when the process has stopped.
:param returncode: Process returncode
"""
if self._started:
log.info("Process VPCS is dead. Return code: %d", returncode)
log.info("VPCS process has stopped, return code: %d", returncode)
self._started = False
self.status = "stopped"
self._process = None