1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fixes C7200 IO cards insert/remove issues and makes C7200-IO-FE the default.

This commit is contained in:
Jeremy 2014-11-24 17:02:00 -07:00
parent 4918675cd5
commit d97ba11728
4 changed files with 8 additions and 8 deletions

View File

@ -73,8 +73,8 @@ import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
ADAPTER_MATRIX = {"C7200_IO_2FE": C7200_IO_2FE, ADAPTER_MATRIX = {"C7200-IO-2FE": C7200_IO_2FE,
"C7200_IO_FE": C7200_IO_FE, "C7200-IO-FE": C7200_IO_FE,
"C7200-IO-GE-E": C7200_IO_GE_E, "C7200-IO-GE-E": C7200_IO_GE_E,
"NM-16ESW": NM_16ESW, "NM-16ESW": NM_16ESW,
"NM-1E": NM_1E, "NM-1E": NM_1E,
@ -468,7 +468,7 @@ class VM(object):
except DynamipsError as e: except DynamipsError as e:
self.send_custom_error(str(e)) self.send_custom_error(str(e))
return return
elif name.startswith("slot") and value == None: elif name.startswith("slot") and value is None:
slot_id = int(name[-1]) slot_id = int(name[-1])
if router.slots[slot_id]: if router.slots[slot_id]:
try: try:

View File

@ -22,7 +22,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L294
from ..dynamips_error import DynamipsError from ..dynamips_error import DynamipsError
from .router import Router from .router import Router
from ..adapters.c7200_io_2fe import C7200_IO_2FE from ..adapters.c7200_io_fe import C7200_IO_FE
from ..adapters.c7200_io_ge_e import C7200_IO_GE_E from ..adapters.c7200_io_ge_e import C7200_IO_GE_E
import logging import logging
@ -70,7 +70,7 @@ class C7200(Router):
if npe == "npe-g2": if npe == "npe-g2":
self.slot_add_binding(0, C7200_IO_GE_E()) self.slot_add_binding(0, C7200_IO_GE_E())
else: else:
self.slot_add_binding(0, C7200_IO_2FE()) self.slot_add_binding(0, C7200_IO_FE())
def defaults(self): def defaults(self):
""" """

View File

@ -1324,7 +1324,7 @@ class Router(object):
adapter=current_adapter)) adapter=current_adapter))
# Only c7200, c3600 and c3745 (NM-4T only) support new adapter while running # Only c7200, c3600 and c3745 (NM-4T only) support new adapter while running
if self.is_running() and not (self._platform == 'c7200' if self.is_running() and not ((self._platform == 'c7200' and not str(adapter).startswith('C7200'))
and not (self._platform == 'c3600' and self.chassis == '3660') and not (self._platform == 'c3600' and self.chassis == '3660')
and not (self._platform == 'c3745' and adapter == 'NM-4T')): and not (self._platform == 'c3745' and adapter == 'NM-4T')):
raise DynamipsError("Adapter {adapter} cannot be added while router {name} is running".format(adapter=adapter, raise DynamipsError("Adapter {adapter} cannot be added while router {name} is running".format(adapter=adapter,
@ -1369,7 +1369,7 @@ class Router(object):
slot_id=slot_id)) slot_id=slot_id))
# Only c7200, c3600 and c3745 (NM-4T only) support to remove adapter while running # Only c7200, c3600 and c3745 (NM-4T only) support to remove adapter while running
if self.is_running() and not (self._platform == 'c7200' if self.is_running() and not ((self._platform == 'c7200' and not str(adapter).startswith('C7200'))
and not (self._platform == 'c3600' and self.chassis == '3660') and not (self._platform == 'c3600' and self.chassis == '3660')
and not (self._platform == 'c3745' and adapter == 'NM-4T')): and not (self._platform == 'c3745' and adapter == 'NM-4T')):
raise DynamipsError("Adapter {adapter} cannot be removed while router {name} is running".format(adapter=adapter, raise DynamipsError("Adapter {adapter} cannot be removed while router {name} is running".format(adapter=adapter,

View File

@ -184,7 +184,6 @@ class Server(object):
except KeyError: except KeyError:
log.info("Missing cloud.conf - disabling HTTP auth and SSL") log.info("Missing cloud.conf - disabling HTTP auth and SSL")
router = self._create_zmq_router() router = self._create_zmq_router()
# Add our JSON-RPC Websocket handler to Tornado # Add our JSON-RPC Websocket handler to Tornado
self.handlers.extend([(r"/", JSONRPCWebSocket, dict(zmq_router=router))]) self.handlers.extend([(r"/", JSONRPCWebSocket, dict(zmq_router=router))])
@ -208,6 +207,7 @@ class Server(object):
if parse_version(tornado.version) >= parse_version("3.1"): if parse_version(tornado.version) >= parse_version("3.1"):
kwargs["max_buffer_size"] = 524288000 # 500 MB file upload limit kwargs["max_buffer_size"] = 524288000 # 500 MB file upload limit
tornado_app.listen(self._port, **kwargs) tornado_app.listen(self._port, **kwargs)
except OSError as e: except OSError as e:
if e.errno == errno.EADDRINUSE: # socket already in use if e.errno == errno.EADDRINUSE: # socket already in use