Use black with -l 120 param.

This commit is contained in:
grossmj committed 2021-04-13 18:46:50 +09:30
1 parent f928738bd5
commit c021e21309
194 files changed
+6034 -4564

No files matched your search

+27 -13
View File
@@ -25,6 +25,7 @@ from ..adapters.c1700_mb_1fe import C1700_MB_1FE
from ..adapters.c1700_mb_wic1 import C1700_MB_WIC1
import logging
log = logging.getLogger(__name__)
@@ -47,9 +48,23 @@ class C1700(Router):
1710 is not supported.
"""
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis="1720"):
def __init__(
self,
name,
node_id,
project,
manager,
dynamips_id,
console=None,
console_type="telnet",
aux=None,
aux_type="none",
chassis="1720",
):
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c1700")
super().__init__(
name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c1700"
)
# Set default values for this platform (must be the same as Dynamips)
self._ram = 64
@@ -63,9 +78,7 @@ class C1700(Router):
def __json__(self):
c1700_router_info = {"iomem": self._iomem,
"chassis": self._chassis,
"sparsemem": self._sparsemem}
c1700_router_info = {"iomem": self._iomem, "chassis": self._chassis, "sparsemem": self._sparsemem}
router_info = Router.__json__(self)
router_info.update(c1700_router_info)
@@ -86,7 +99,7 @@ class C1700(Router):
# With 1751 and 1760, WICs in WIC slot 1 show up as in slot 1, not 0
# e.g. s1/0 not s0/2
if self._chassis in ['1751', '1760']:
if self._chassis in ["1751", "1760"]:
self._create_slots(2)
self._slots[1] = C1700_MB_WIC1()
else:
@@ -113,9 +126,9 @@ class C1700(Router):
await self._hypervisor.send(f'c1700 set_chassis "{self._name}" {chassis}')
log.info('Router "{name}" [{id}]: chassis set to {chassis}'.format(name=self._name,
id=self._id,
chassis=chassis))
log.info(
'Router "{name}" [{id}]: chassis set to {chassis}'.format(name=self._name, id=self._id, chassis=chassis)
)
self._chassis = chassis
self._setup_chassis()
@@ -139,8 +152,9 @@ class C1700(Router):
await self._hypervisor.send(f'c1700 set_iomem "{self._name}" {iomem}')
log.info('Router "{name}" [{id}]: I/O memory updated from {old_iomem}% to {new_iomem}%'.format(name=self._name,
id=self._id,
old_iomem=self._iomem,
new_iomem=iomem))
log.info(
'Router "{name}" [{id}]: I/O memory updated from {old_iomem}% to {new_iomem}%'.format(
name=self._name, id=self._id, old_iomem=self._iomem, new_iomem=iomem
)
)
self._iomem = iomem