1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-13 20:08:55 +00:00

Raise an error if uBridge is not installed

This commit is contained in:
Julien Duponchelle 2016-07-12 17:38:13 +02:00
parent ee533943c8
commit 3d52e18fa5
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 7 additions and 1 deletions

View File

@ -452,7 +452,7 @@ class BaseNode:
""" """
path = self._manager.config.get_section_config("Server").get("ubridge_path", "ubridge") path = self._manager.config.get_section_config("Server").get("ubridge_path", "ubridge")
if path == "ubridge": if path == "ubridge" or path == "None":
path = shutil.which("ubridge") path = shutil.which("ubridge")
if path is None or len(path) == 0: if path is None or len(path) == 0:
@ -480,6 +480,9 @@ class BaseNode:
Starts uBridge (handles connections to and from this node). Starts uBridge (handles connections to and from this node).
""" """
if self.ubridge_path is None:
raise NodeError("uBridge is not available")
if not self._manager.has_privileged_access(self.ubridge_path): if not self._manager.has_privileged_access(self.ubridge_path):
raise NodeError("uBridge requires root access or capability to interact with network adapters") raise NodeError("uBridge requires root access or capability to interact with network adapters")

View File

@ -216,6 +216,9 @@ def _convert_1_3_later(topo):
node["node_type"] = "virtualbox" node["node_type"] = "virtualbox"
if node["symbol"] is None: if node["symbol"] is None:
node["symbol"] = ":/symbols/vbox_guest.svg" node["symbol"] = ":/symbols/vbox_guest.svg"
elif old_node["type"] == "Cloud":
node["node_type"] = "cloud"
node["symbol"] = ":/symbols/cloud.svg"
else: else:
raise NotImplementedError("Conversion of {} is not supported".format(old_node["type"])) raise NotImplementedError("Conversion of {} is not supported".format(old_node["type"]))