mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Nat node is only on the GNS3 VM for the moment
Fix https://github.com/GNS3/gns3-gui/issues/1448
This commit is contained in:
3 files changed
+19
-3
No files matched your search
@@ -21,7 +21,7 @@ Builtin nodes server module.
|
||||
|
||||
|
||||
from ..base_manager import BaseManager
|
||||
from .builtin_node_factory import BuiltinNodeFactory
|
||||
from .builtin_node_factory import BuiltinNodeFactory, BUILTIN_NODES
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -40,4 +40,7 @@ class Builtin(BaseManager):
|
||||
"""
|
||||
:returns: List of node type supported by this class and computer
|
||||
"""
|
||||
return ['cloud', 'nat', 'ethernet_hub', 'ethernet_switch']
|
||||
types = ['cloud', 'ethernet_hub', 'ethernet_switch']
|
||||
if BUILTIN_NODES['nat'].is_supported():
|
||||
types.append('nat')
|
||||
return types
|
||||
@@ -41,6 +41,10 @@ class Nat(Cloud):
|
||||
}
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def is_supported(self):
|
||||
return socket.gethostname() == "gns3vm"
|
||||
|
||||
def __json__(self):
|
||||
return {
|
||||
"name": self.name,
|
||||
|
||||
Reference in new issue
Block a user