Fix small errors like unhandled exceptions etc.

This commit is contained in:
grossmj committed 2018-09-11 15:06:01 +02:00
1 parent 0aa9ab53d1
commit 17d657c919
12 files changed
+37 -26

No files matched your search

+1 -1
View File
@@ -163,7 +163,7 @@ class Cloud(BaseNode):
try:
output = yield from gns3server.utils.asyncio.subprocess_check_output("networksetup", "-listallhardwareports")
except (FileNotFoundError, subprocess.SubprocessError) as e:
except (OSError, subprocess.SubprocessError) as e:
log.warn("Could not execute networksetup: {}".format(e))
return False
+2 -2
View File
@@ -526,8 +526,8 @@ class DockerVM(BaseNode):
x11_socket = os.path.join("/tmp/.X11-unix/", "X{}".format(self._display))
yield from wait_for_file_creation(x11_socket)
monitor_process(self._xvfb_process, self._xvfb_callback)
monitor_process(self._x11vnc_process, self._x11vnc_callback)
#monitor_process(self._xvfb_process, self._xvfb_callback)
#monitor_process(self._x11vnc_process, self._x11vnc_callback)
def _xvfb_callback(self, returncode):
"""
+2 -2
View File
@@ -368,7 +368,7 @@ class IOUVM(BaseNode):
try:
output = yield from gns3server.utils.asyncio.subprocess_check_output("ldd", self._path)
except (FileNotFoundError, subprocess.SubprocessError) as e:
except (OSError, subprocess.SubprocessError) as e:
log.warn("Could not determine the shared library dependencies for {}: {}".format(self._path, e))
return
@@ -421,7 +421,7 @@ class IOUVM(BaseNode):
hostid = (yield from gns3server.utils.asyncio.subprocess_check_output("hostid")).strip()
except FileNotFoundError as e:
raise IOUError("Could not find hostid: {}".format(e))
except subprocess.SubprocessError as e:
except (OSError, subprocess.SubprocessError) as e:
raise IOUError("Could not execute hostid: {}".format(e))
try:
+2 -2
View File
@@ -193,7 +193,7 @@ class Qemu(BaseManager):
return version
else:
raise QemuError("Could not determine the Qemu version for {}".format(qemu_path))
except subprocess.SubprocessError as e:
except (OSError, subprocess.SubprocessError) as e:
raise QemuError("Error while looking for the Qemu version: {}".format(e))
@staticmethod
@@ -213,7 +213,7 @@ class Qemu(BaseManager):
return version
else:
raise QemuError("Could not determine the Qemu-img version for {}".format(qemu_img_path))
except subprocess.SubprocessError as e:
except (OSError, subprocess.SubprocessError) as e:
raise QemuError("Error while looking for the Qemu-img version: {}".format(e))
@staticmethod
@@ -217,6 +217,8 @@ class VirtualBoxVM(BaseNode):
except ET.ParseError:
raise VirtualBoxError("Cannot modify VirtualBox linked nodes file. "
"File {} is corrupted.".format(self._linked_vbox_file()))
except OSError as e:
raise VirtualBoxError("Cannot modify VirtualBox linked nodes file '{}': {}".format(self._linked_vbox_file(), e))
machine = tree.getroot().find("{http://www.virtualbox.org/}Machine")
if machine is not None and machine.get("uuid") != "{" + self.id + "}":
@@ -245,6 +247,7 @@ class VirtualBoxVM(BaseNode):
return True
return False
@locking
@asyncio.coroutine
def start(self):
"""