mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Prevent connect a node to himself
Fix https://github.com/GNS3/gns3-gui/issues/1553
This commit is contained in:
7 files changed
+79
-7
No files matched your search
@@ -463,6 +463,7 @@ class BaseNode:
|
||||
:param command: command to send
|
||||
"""
|
||||
|
||||
print(self._ubridge_hypervisor)
|
||||
if not self._ubridge_hypervisor or not self._ubridge_hypervisor.is_running():
|
||||
raise NodeError("Cannot send command '{}': uBridge is not running".format(command))
|
||||
try:
|
||||
@@ -498,6 +499,7 @@ class BaseNode:
|
||||
"""
|
||||
|
||||
if self._ubridge_hypervisor and self._ubridge_hypervisor.is_running():
|
||||
log.info("Stopping uBridge hypervisor {}:{}".format(self._ubridge_hypervisor.host, self._ubridge_hypervisor.port))
|
||||
yield from self._ubridge_hypervisor.stop()
|
||||
|
||||
@asyncio.coroutine
|
||||
|
||||
@@ -259,6 +259,9 @@ class Cloud(BaseNode):
|
||||
self._nios[port_number] = nio
|
||||
try:
|
||||
yield from self._add_ubridge_connection(nio, port_number)
|
||||
except NodeError as e:
|
||||
del self._nios[port_number]
|
||||
raise e
|
||||
# Cleanup stuff
|
||||
except UbridgeError as e:
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user