mirror of
https://github.com/GNS3/gns3-server
synced 2025-02-20 03:52:00 +00:00
Auto PEP8 cleanup
This commit is contained in:
parent
a4669689e7
commit
68427eaddf
@ -215,7 +215,7 @@ class Dynamips(BaseManager):
|
|||||||
rhost = nio_settings["rhost"]
|
rhost = nio_settings["rhost"]
|
||||||
rport = nio_settings["rport"]
|
rport = nio_settings["rport"]
|
||||||
try:
|
try:
|
||||||
#TODO: handle IPv6
|
# TODO: handle IPv6
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
|
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
|
||||||
sock.connect((rhost, rport))
|
sock.connect((rhost, rport))
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class Adapter(object):
|
class Adapter(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base class for adapters.
|
Base class for adapters.
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C1700_MB_1FE(Adapter):
|
class C1700_MB_1FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 1 port FastEthernet adapter for c1700 platform.
|
Integrated 1 port FastEthernet adapter for c1700 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C1700_MB_WIC1(Adapter):
|
class C1700_MB_WIC1(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Fake module to provide a placeholder for slot 1 interfaces when WICs
|
Fake module to provide a placeholder for slot 1 interfaces when WICs
|
||||||
are inserted into WIC slot 1.
|
are inserted into WIC slot 1.
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_1E(Adapter):
|
class C2600_MB_1E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 1 port Ethernet adapter for the c2600 platform.
|
Integrated 1 port Ethernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_1FE(Adapter):
|
class C2600_MB_1FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 1 port FastEthernet adapter for the c2600 platform.
|
Integrated 1 port FastEthernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_2E(Adapter):
|
class C2600_MB_2E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 2 port Ethernet adapter for the c2600 platform.
|
Integrated 2 port Ethernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_2FE(Adapter):
|
class C2600_MB_2FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 2 port FastEthernet adapter for the c2600 platform.
|
Integrated 2 port FastEthernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C7200_IO_2FE(Adapter):
|
class C7200_IO_2FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
C7200-IO-2FE FastEthernet Input/Ouput controller.
|
C7200-IO-2FE FastEthernet Input/Ouput controller.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C7200_IO_FE(Adapter):
|
class C7200_IO_FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
C7200-IO-FE FastEthernet Input/Ouput controller.
|
C7200-IO-FE FastEthernet Input/Ouput controller.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C7200_IO_GE_E(Adapter):
|
class C7200_IO_GE_E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
C7200-IO-GE-E GigabitEthernet Input/Ouput controller.
|
C7200-IO-GE-E GigabitEthernet Input/Ouput controller.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class Leopard_2FE(Adapter):
|
class Leopard_2FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 2 port FastEthernet adapter for c3660 router.
|
Integrated 2 port FastEthernet adapter for c3660 router.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_16ESW(Adapter):
|
class NM_16ESW(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-16ESW FastEthernet network module.
|
NM-16ESW FastEthernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_1E(Adapter):
|
class NM_1E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-1E Ethernet network module.
|
NM-1E Ethernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_1FE_TX(Adapter):
|
class NM_1FE_TX(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-1FE-TX FastEthernet network module.
|
NM-1FE-TX FastEthernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_4E(Adapter):
|
class NM_4E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-4E Ethernet network module.
|
NM-4E Ethernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_4T(Adapter):
|
class NM_4T(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-4T Serial network module.
|
NM-4T Serial network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_2FE_TX(Adapter):
|
class PA_2FE_TX(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-2FE-TX FastEthernet port adapter.
|
PA-2FE-TX FastEthernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_4E(Adapter):
|
class PA_4E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-4E Ethernet port adapter.
|
PA-4E Ethernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_4T(Adapter):
|
class PA_4T(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-4T+ Serial port adapter.
|
PA-4T+ Serial port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_8E(Adapter):
|
class PA_8E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-8E Ethernet port adapter.
|
PA-8E Ethernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_8T(Adapter):
|
class PA_8T(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-8T Serial port adapter.
|
PA-8T Serial port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_A1(Adapter):
|
class PA_A1(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-A1 ATM port adapter.
|
PA-A1 ATM port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_FE_TX(Adapter):
|
class PA_FE_TX(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-FE-TX FastEthernet port adapter.
|
PA-FE-TX FastEthernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_GE(Adapter):
|
class PA_GE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-GE GigabitEthernet port adapter.
|
PA-GE GigabitEthernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_POS_OC3(Adapter):
|
class PA_POS_OC3(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-POS-OC3 port adapter.
|
PA-POS-OC3 port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class WIC_1ENET(object):
|
class WIC_1ENET(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
WIC-1ENET Ethernet
|
WIC-1ENET Ethernet
|
||||||
"""
|
"""
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class WIC_1T(object):
|
class WIC_1T(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
WIC-1T Serial
|
WIC-1T Serial
|
||||||
"""
|
"""
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class WIC_2T(object):
|
class WIC_2T(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
WIC-2T Serial
|
WIC-2T Serial
|
||||||
"""
|
"""
|
||||||
|
@ -32,6 +32,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class DynamipsHypervisor:
|
class DynamipsHypervisor:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Creates a new connection to a Dynamips server (also called hypervisor)
|
Creates a new connection to a Dynamips server (also called hypervisor)
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ PLATFORMS = {'c1700': C1700,
|
|||||||
|
|
||||||
|
|
||||||
class DynamipsVM:
|
class DynamipsVM:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Factory to create an Router object based on the correct platform.
|
Factory to create an Router object based on the correct platform.
|
||||||
"""
|
"""
|
||||||
|
@ -32,6 +32,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Hypervisor(DynamipsHypervisor):
|
class Hypervisor(DynamipsHypervisor):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Hypervisor.
|
Hypervisor.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO:
|
class NIO:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base NIO class
|
Base NIO class
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOFIFO(NIO):
|
class NIOFIFO(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips FIFO NIO.
|
Dynamips FIFO NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOGenericEthernet(NIO):
|
class NIOGenericEthernet(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips generic Ethernet NIO.
|
Dynamips generic Ethernet NIO.
|
||||||
|
|
||||||
@ -46,8 +47,6 @@ class NIOGenericEthernet(NIO):
|
|||||||
self._name = 'nio_gen_eth' + str(self._id)
|
self._name = 'nio_gen_eth' + str(self._id)
|
||||||
self._ethernet_device = ethernet_device
|
self._ethernet_device = ethernet_device
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def reset(cls):
|
def reset(cls):
|
||||||
"""
|
"""
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOLinuxEthernet(NIO):
|
class NIOLinuxEthernet(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips Linux Ethernet NIO.
|
Dynamips Linux Ethernet NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOMcast(NIO):
|
class NIOMcast(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips Linux Ethernet NIO.
|
Dynamips Linux Ethernet NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIONull(NIO):
|
class NIONull(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips NULL NIO.
|
Dynamips NULL NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOTAP(NIO):
|
class NIOTAP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips TAP NIO.
|
Dynamips TAP NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOUDP(NIO):
|
class NIOUDP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips UDP NIO.
|
Dynamips UDP NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOUDPAuto(NIO):
|
class NIOUDPAuto(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips auto UDP NIO.
|
Dynamips auto UDP NIO.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOUNIX(NIO):
|
class NIOUNIX(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips UNIX NIO.
|
Dynamips UNIX NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIOVDE(NIO):
|
class NIOVDE(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips VDE NIO.
|
Dynamips VDE NIO.
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C1700(Router):
|
class C1700(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c1700 router.
|
Dynamips c1700 router.
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C2600(Router):
|
class C2600(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c2600 router.
|
Dynamips c2600 router.
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C2691(Router):
|
class C2691(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c2691 router.
|
Dynamips c2691 router.
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C3600(Router):
|
class C3600(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c3600 router.
|
Dynamips c3600 router.
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C3725(Router):
|
class C3725(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c3725 router.
|
Dynamips c3725 router.
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C3745(Router):
|
class C3745(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c3745 router.
|
Dynamips c3745 router.
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C7200(Router):
|
class C7200(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c7200 router (model is 7206).
|
Dynamips c7200 router (model is 7206).
|
||||||
|
|
||||||
|
@ -145,14 +145,14 @@ class Router(BaseVM):
|
|||||||
"system_id": self._system_id}
|
"system_id": self._system_id}
|
||||||
|
|
||||||
# FIXME: add default slots/wics
|
# FIXME: add default slots/wics
|
||||||
#slot_id = 0
|
# slot_id = 0
|
||||||
#for slot in self._slots:
|
# for slot in self._slots:
|
||||||
# if slot:
|
# if slot:
|
||||||
# slot = str(slot)
|
# slot = str(slot)
|
||||||
# router_defaults["slot" + str(slot_id)] = slot
|
# router_defaults["slot" + str(slot_id)] = slot
|
||||||
# slot_id += 1
|
# slot_id += 1
|
||||||
|
|
||||||
#if self._slots[0] and self._slots[0].wics:
|
# if self._slots[0] and self._slots[0].wics:
|
||||||
# for wic_slot_id in range(0, len(self._slots[0].wics)):
|
# for wic_slot_id in range(0, len(self._slots[0].wics)):
|
||||||
# router_defaults["wic" + str(wic_slot_id)] = None
|
# router_defaults["wic" + str(wic_slot_id)] = None
|
||||||
|
|
||||||
@ -1253,6 +1253,7 @@ class Router(BaseVM):
|
|||||||
id=self._id,
|
id=self._id,
|
||||||
slot_id=slot_id,
|
slot_id=slot_id,
|
||||||
port_id=port_id))
|
port_id=port_id))
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def slot_disable_nio(self, slot_id, port_id):
|
def slot_disable_nio(self, slot_id, port_id):
|
||||||
"""
|
"""
|
||||||
@ -1301,11 +1302,10 @@ class Router(BaseVM):
|
|||||||
raise DynamipsError("Port {port_id} has already a filter applied on {adapter}".format(adapter=adapter,
|
raise DynamipsError("Port {port_id} has already a filter applied on {adapter}".format(adapter=adapter,
|
||||||
port_id=port_id))
|
port_id=port_id))
|
||||||
|
|
||||||
|
|
||||||
# FIXME: capture
|
# FIXME: capture
|
||||||
#try:
|
# try:
|
||||||
# os.makedirs(os.path.dirname(output_file), exist_ok=True)
|
# os.makedirs(os.path.dirname(output_file), exist_ok=True)
|
||||||
#except OSError as e:
|
# except OSError as e:
|
||||||
# raise DynamipsError("Could not create captures directory {}".format(e))
|
# raise DynamipsError("Could not create captures directory {}".format(e))
|
||||||
|
|
||||||
yield from nio.bind_filter("both", "capture")
|
yield from nio.bind_filter("both", "capture")
|
||||||
@ -1316,6 +1316,7 @@ class Router(BaseVM):
|
|||||||
nio_name=nio.name,
|
nio_name=nio.name,
|
||||||
slot_id=slot_id,
|
slot_id=slot_id,
|
||||||
port_id=port_id))
|
port_id=port_id))
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def stop_capture(self, slot_id, port_id):
|
def stop_capture(self, slot_id, port_id):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user