mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Chassis and private-config support
This commit is contained in:
1 parent
0e1d8e5071
commit
99cc7345b8
4 files changed
+90
-27
No files matched your search
@@ -86,7 +86,9 @@ class C7200(Router):
|
||||
"disk1": self._disk1,
|
||||
"npe": self._npe,
|
||||
"midplane": self._midplane,
|
||||
"clock_divisor": self._clock_divisor}
|
||||
"clock_divisor": self._clock_divisor,
|
||||
"sensors": self._sensors,
|
||||
"power_supplies": self._power_supplies}
|
||||
|
||||
# update the router defaults with the platform specific defaults
|
||||
router_defaults.update(platform_defaults)
|
||||
@@ -230,3 +232,17 @@ class C7200(Router):
|
||||
power_supply_id += 1
|
||||
|
||||
self._power_supplies = power_supplies
|
||||
|
||||
def start(self):
|
||||
"""
|
||||
Starts this router.
|
||||
At least the IOS image must be set before starting it.
|
||||
"""
|
||||
|
||||
# trick: we must send sensors and power supplies info after starting the router
|
||||
# otherwise they are not taken into account (Dynamips bug?)
|
||||
Router.start(self)
|
||||
if self._sensors != [22, 22, 22, 22]:
|
||||
self.sensors = self._sensors
|
||||
if self._power_supplies != [1, 1]:
|
||||
self.power_supplies = self._power_supplies
|
||||
@@ -452,11 +452,15 @@ class Router(object):
|
||||
id=self._id,
|
||||
startup='"' + startup_config + '"'))
|
||||
|
||||
self._startup_config = startup_config
|
||||
|
||||
if private_config:
|
||||
log.info("router {name} [id={id}]: has a private-config set: {private}".format(name=self._name,
|
||||
id=self._id,
|
||||
private='"' + private_config + '"'))
|
||||
|
||||
self._private_config = private_config
|
||||
|
||||
def extract_config(self):
|
||||
"""
|
||||
Gets the contents of the config files
|
||||
@@ -1180,9 +1184,9 @@ class Router(object):
|
||||
|
||||
# Generate an OIR event if the router is running and
|
||||
# only for c7200, c3600 and c3745 (NM-4T only)
|
||||
if self.is_running() and self._platform == 'c7200' \
|
||||
if self.is_running() and (self._platform == 'c7200' \
|
||||
or (self._platform == 'c3600' and self.chassis == '3660') \
|
||||
or (self._platform == 'c3745' and adapter == 'NM-4T'):
|
||||
or (self._platform == 'c3745' and adapter == 'NM-4T')):
|
||||
|
||||
self._hypervisor.send("vm slot_oir_start {name} {slot_id} 0".format(name=self._name,
|
||||
slot_id=slot_id))
|
||||
@@ -1212,9 +1216,9 @@ class Router(object):
|
||||
|
||||
# Generate an OIR event if the router is running and
|
||||
# only for c7200, c3600 and c3745 (NM-4T only)
|
||||
if self.is_running() and self._platform == 'c7200' \
|
||||
if self.is_running() and (self._platform == 'c7200' \
|
||||
or (self._platform == 'c3600' and self.chassis == '3660') \
|
||||
or (self._platform == 'c3745' and adapter == 'NM-4T'):
|
||||
or (self._platform == 'c3745' and adapter == 'NM-4T')):
|
||||
|
||||
self._hypervisor.send("vm slot_oir_stop {name} {slot_id} 0".format(name=self._name,
|
||||
slot_id=slot_id))
|
||||
|
||||
Reference in new issue
Block a user