mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Initialize chassis when creating an IOS router. Fixes #107.
This commit is contained in:
parent
17d5b3a7bc
commit
628dfef0d3
@ -58,7 +58,8 @@ class DynamipsVMHandler:
|
||||
request.json.get("dynamips_id"),
|
||||
request.json.pop("platform"),
|
||||
console=request.json.get("console"),
|
||||
aux=request.json.get("aux"))
|
||||
aux=request.json.get("aux"),
|
||||
chassis=request.json.pop("chassis", None))
|
||||
|
||||
yield from dynamips_manager.update_vm_settings(vm, request.json)
|
||||
yield from dynamips_manager.ghost_ios_support(vm)
|
||||
|
@ -23,6 +23,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L387
|
||||
import asyncio
|
||||
from .router import Router
|
||||
from ..adapters.gt96100_fe import GT96100_FE
|
||||
from ..dynamips_error import DynamipsError
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@ -42,7 +43,7 @@ class C2691(Router):
|
||||
:param aux: auxiliary console port
|
||||
"""
|
||||
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None):
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, chassis=None):
|
||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c2691")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
@ -56,6 +57,9 @@ class C2691(Router):
|
||||
self._create_slots(2)
|
||||
self._slots[0] = GT96100_FE()
|
||||
|
||||
if chassis is not None:
|
||||
raise DynamipsError("c2691 routers do not have chassis")
|
||||
|
||||
def __json__(self):
|
||||
|
||||
c2691_router_info = {"iomem": self._iomem}
|
||||
|
@ -23,6 +23,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L346
|
||||
import asyncio
|
||||
from .router import Router
|
||||
from ..adapters.gt96100_fe import GT96100_FE
|
||||
from ..dynamips_error import DynamipsError
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@ -42,7 +43,7 @@ class C3725(Router):
|
||||
:param aux: auxiliary console port
|
||||
"""
|
||||
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None):
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, chassis=None):
|
||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c3725")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
@ -56,6 +57,9 @@ class C3725(Router):
|
||||
self._create_slots(3)
|
||||
self._slots[0] = GT96100_FE()
|
||||
|
||||
if chassis is not None:
|
||||
raise DynamipsError("c3725 routers do not have chassis")
|
||||
|
||||
def __json__(self):
|
||||
|
||||
c3725_router_info = {"iomem": self._iomem}
|
||||
|
@ -23,6 +23,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L326
|
||||
import asyncio
|
||||
from .router import Router
|
||||
from ..adapters.gt96100_fe import GT96100_FE
|
||||
from ..dynamips_error import DynamipsError
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@ -42,7 +43,7 @@ class C3745(Router):
|
||||
:param aux: auxiliary console port
|
||||
"""
|
||||
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None):
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, chassis=None):
|
||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c3745")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
@ -56,6 +57,9 @@ class C3745(Router):
|
||||
self._create_slots(5)
|
||||
self._slots[0] = GT96100_FE()
|
||||
|
||||
if chassis is not None:
|
||||
raise DynamipsError("c3745 routers do not have chassis")
|
||||
|
||||
def __json__(self):
|
||||
|
||||
c3745_router_info = {"iomem": self._iomem}
|
||||
|
@ -22,10 +22,10 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L294
|
||||
|
||||
import asyncio
|
||||
|
||||
from ..dynamips_error import DynamipsError
|
||||
from .router import Router
|
||||
from ..adapters.c7200_io_fe import C7200_IO_FE
|
||||
from ..adapters.c7200_io_ge_e import C7200_IO_GE_E
|
||||
from ..dynamips_error import DynamipsError
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@ -46,7 +46,7 @@ class C7200(Router):
|
||||
:param npe: Default NPE
|
||||
"""
|
||||
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, npe="npe-400"):
|
||||
def __init__(self, name, vm_id, project, manager, dynamips_id, console=None, aux=None, npe="npe-400", chassis=None):
|
||||
Router.__init__(self, name, vm_id, project, manager, dynamips_id, console, aux, platform="c7200")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
@ -71,6 +71,9 @@ class C7200(Router):
|
||||
|
||||
self._create_slots(7)
|
||||
|
||||
if chassis is not None:
|
||||
raise DynamipsError("c7200 routers do not have chassis")
|
||||
|
||||
def __json__(self):
|
||||
|
||||
c7200_router_info = {"npe": self._npe,
|
||||
|
Loading…
Reference in New Issue
Block a user