mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
Use uBridge for VPCS connections. Ref #267.
This commit is contained in:
1 parent
b456a363ca
commit
00da15e4af
7 files changed
+253
-17
No files matched your search
@@ -240,6 +240,26 @@ class Project:
|
||||
|
||||
self._nodes.add(node)
|
||||
|
||||
def get_node(self, node_id):
|
||||
"""
|
||||
Returns a Node instance.
|
||||
|
||||
:param node_id: Node identifier
|
||||
|
||||
:returns: Node instance
|
||||
"""
|
||||
|
||||
try:
|
||||
UUID(node_id, version=4)
|
||||
except ValueError:
|
||||
raise aiohttp.web.HTTPBadRequest(text="Node ID {} is not a valid UUID".format(node_id))
|
||||
|
||||
for node in self._nodes:
|
||||
if node.id == node_id:
|
||||
return node
|
||||
|
||||
raise aiohttp.web.HTTPNotFound(text="Node ID {} doesn't exist".format(node_id))
|
||||
|
||||
def remove_node(self, node):
|
||||
"""
|
||||
Removes a node from the project.
|
||||
|
||||
Reference in new issue
Block a user