diff --git a/daemon/core/api/grpc/client.py b/daemon/core/api/grpc/client.py index 496c722f..1f98c985 100644 --- a/daemon/core/api/grpc/client.py +++ b/daemon/core/api/grpc/client.py @@ -14,7 +14,7 @@ from core.api.grpc import core_pb2, core_pb2_grpc from core.nodes.ipaddress import Ipv4Prefix, Ipv6Prefix, MacAddress -class InterfaceHelper(object): +class InterfaceHelper: """ Convenience class to help generate IP4 and IP6 addresses for gRPC clients. """ @@ -133,7 +133,7 @@ def start_streamer(stream, handler): thread.start() -class CoreGrpcClient(object): +class CoreGrpcClient: """ Provides convenience methods for interfacing with the CORE grpc server. """ diff --git a/daemon/core/api/tlv/coreapi.py b/daemon/core/api/tlv/coreapi.py index 0fd16bf5..95818598 100644 --- a/daemon/core/api/tlv/coreapi.py +++ b/daemon/core/api/tlv/coreapi.py @@ -27,7 +27,7 @@ from core.emulator.enumerations import ( from core.nodes.ipaddress import IpAddress, MacAddress -class CoreTlvData(object): +class CoreTlvData: """ Helper base class used for packing and unpacking values using struct. """ @@ -348,7 +348,7 @@ class CoreTlvDataMacAddr(CoreTlvDataObj): return MacAddress(address=value[2:]) -class CoreTlv(object): +class CoreTlv: """ Base class for representing CORE TLVs. """ @@ -670,7 +670,7 @@ class CoreExceptionTlv(CoreTlv): } -class CoreMessage(object): +class CoreMessage: """ Base class for representing CORE messages. """ diff --git a/daemon/core/config.py b/daemon/core/config.py index e55d5f17..05ab5183 100644 --- a/daemon/core/config.py +++ b/daemon/core/config.py @@ -8,7 +8,7 @@ from collections import OrderedDict from core.emulator.data import ConfigData -class ConfigShim(object): +class ConfigShim: """ Provides helper methods for converting newer configuration values into TLV compatible formats. """ @@ -102,7 +102,7 @@ class ConfigShim(object): ) -class Configuration(object): +class Configuration: """ Represents a configuration options. """ @@ -131,7 +131,7 @@ class Configuration(object): return f"{self.__class__.__name__}(id={self.id}, type={self.type}, default={self.default}, options={self.options})" -class ConfigurableManager(object): +class ConfigurableManager: """ Provides convenience methods for storing and retrieving configuration options for nodes. """ @@ -240,7 +240,7 @@ class ConfigurableManager(object): return self.node_configurations.get(node_id) -class ConfigGroup(object): +class ConfigGroup: """ Defines configuration group tabs used for display by ConfigurationOptions. """ @@ -258,7 +258,7 @@ class ConfigGroup(object): self.stop = stop -class ConfigurableOptions(object): +class ConfigurableOptions: """ Provides a base for defining configuration options within CORE. """ diff --git a/daemon/core/emulator/coreemu.py b/daemon/core/emulator/coreemu.py index 9c8b35ee..237000c7 100644 --- a/daemon/core/emulator/coreemu.py +++ b/daemon/core/emulator/coreemu.py @@ -29,7 +29,7 @@ signal.signal(signal.SIGUSR1, signal_handler) signal.signal(signal.SIGUSR2, signal_handler) -class CoreEmu(object): +class CoreEmu: """ Provides logic for creating and configuring CORE sessions and the nodes within them. """ diff --git a/daemon/core/emulator/distributed.py b/daemon/core/emulator/distributed.py index 5abb5bef..c2e90d6b 100644 --- a/daemon/core/emulator/distributed.py +++ b/daemon/core/emulator/distributed.py @@ -21,7 +21,7 @@ LOCK = threading.Lock() CMD_HIDE = True -class DistributedServer(object): +class DistributedServer: """ Provides distributed server interactions. """ @@ -101,7 +101,7 @@ class DistributedServer(object): os.unlink(temp.name) -class DistributedController(object): +class DistributedController: """ Provides logic for dealing with remote tunnels and distributed servers. """ diff --git a/daemon/core/emulator/emudata.py b/daemon/core/emulator/emudata.py index 792a896f..5e59eaae 100644 --- a/daemon/core/emulator/emudata.py +++ b/daemon/core/emulator/emudata.py @@ -4,7 +4,7 @@ from core.nodes.ipaddress import Ipv4Prefix, Ipv6Prefix, MacAddress from core.nodes.physical import PhysicalNode -class IdGen(object): +class IdGen: def __init__(self, _id=0): self.id = _id @@ -61,7 +61,7 @@ def link_config(network, interface, link_options, devname=None, interface_two=No network.linkconfig(**config) -class NodeOptions(object): +class NodeOptions: """ Options for creating and updating nodes within core. """ @@ -115,7 +115,7 @@ class NodeOptions(object): self.alt = alt -class LinkOptions(object): +class LinkOptions: """ Options for creating and updating links within core. """ @@ -145,7 +145,7 @@ class LinkOptions(object): self.opaque = None -class IpPrefixes(object): +class IpPrefixes: """ Convenience class to help generate IP4 and IP6 addresses for nodes within CORE. """ @@ -236,7 +236,7 @@ class IpPrefixes(object): ) -class InterfaceData(object): +class InterfaceData: """ Convenience class for storing interface data. """ diff --git a/daemon/core/emulator/session.py b/daemon/core/emulator/session.py index 6d74f0cd..287e4b3c 100644 --- a/daemon/core/emulator/session.py +++ b/daemon/core/emulator/session.py @@ -71,7 +71,7 @@ NODES_TYPE = {NODES[x]: x for x in NODES} CTRL_NET_ID = 9001 -class Session(object): +class Session: """ CORE session manager. """ diff --git a/daemon/core/location/corelocation.py b/daemon/core/location/corelocation.py index 5f9e11e3..aeab8896 100644 --- a/daemon/core/location/corelocation.py +++ b/daemon/core/location/corelocation.py @@ -11,7 +11,7 @@ from core.emulator.enumerations import RegisterTlvs from core.location import utm -class CoreLocation(object): +class CoreLocation: """ Member of session class for handling global location data. This keeps track of a latitude/longitude/altitude reference point and scale in diff --git a/daemon/core/location/event.py b/daemon/core/location/event.py index 1872ac18..146062d1 100644 --- a/daemon/core/location/event.py +++ b/daemon/core/location/event.py @@ -70,7 +70,7 @@ class Timer(threading.Thread): @total_ordering -class Event(object): +class Event: """ Provides event objects that can be used within the EventLoop class. """ @@ -118,7 +118,7 @@ class Event(object): self.canceled = True -class EventLoop(object): +class EventLoop: """ Provides an event loop for running events. """ diff --git a/daemon/core/location/mobility.py b/daemon/core/location/mobility.py index 92bd1b4b..fd07f0ef 100644 --- a/daemon/core/location/mobility.py +++ b/daemon/core/location/mobility.py @@ -535,7 +535,7 @@ class BasicRangeModel(WirelessModel): @total_ordering -class WayPoint(object): +class WayPoint: """ Maintains information regarding waypoints. """ diff --git a/daemon/core/nodes/base.py b/daemon/core/nodes/base.py index aadd2348..0f0840a1 100644 --- a/daemon/core/nodes/base.py +++ b/daemon/core/nodes/base.py @@ -21,7 +21,7 @@ from core.nodes.netclient import get_net_client _DEFAULT_MTU = 1500 -class NodeBase(object): +class NodeBase: """ Base class for CORE nodes (nodes and networks) """ @@ -1067,7 +1067,7 @@ class CoreNetworkBase(NodeBase): return all_links -class Position(object): +class Position: """ Helper class for Cartesian coordinate position """ diff --git a/daemon/core/nodes/client.py b/daemon/core/nodes/client.py index 3596bfa7..1e949c04 100644 --- a/daemon/core/nodes/client.py +++ b/daemon/core/nodes/client.py @@ -8,7 +8,7 @@ from core import utils from core.constants import VCMD_BIN -class VnodeClient(object): +class VnodeClient: """ Provides client functionality for interacting with a virtual node. """ diff --git a/daemon/core/nodes/docker.py b/daemon/core/nodes/docker.py index a70cfb39..d3d76319 100644 --- a/daemon/core/nodes/docker.py +++ b/daemon/core/nodes/docker.py @@ -10,7 +10,7 @@ from core.nodes.base import CoreNode from core.nodes.netclient import get_net_client -class DockerClient(object): +class DockerClient: def __init__(self, name, image, run): self.name = name self.image = image diff --git a/daemon/core/nodes/interface.py b/daemon/core/nodes/interface.py index 8dd3ac76..4dde287a 100644 --- a/daemon/core/nodes/interface.py +++ b/daemon/core/nodes/interface.py @@ -10,7 +10,7 @@ from core.errors import CoreCommandError from core.nodes.netclient import get_net_client -class CoreInterface(object): +class CoreInterface: """ Base class for network interfaces. """ diff --git a/daemon/core/nodes/ipaddress.py b/daemon/core/nodes/ipaddress.py index df2309ab..c0b4e209 100644 --- a/daemon/core/nodes/ipaddress.py +++ b/daemon/core/nodes/ipaddress.py @@ -9,7 +9,7 @@ import struct from socket import AF_INET, AF_INET6 -class MacAddress(object): +class MacAddress: """ Provides mac address utilities for use within core. """ @@ -77,7 +77,7 @@ class MacAddress(object): return cls(tmpbytes[2:]) -class IpAddress(object): +class IpAddress: """ Provides ip utilities and functionality for use within core. """ @@ -202,7 +202,7 @@ class IpAddress(object): return struct.unpack("!I", value)[0] -class IpPrefix(object): +class IpPrefix: """ Provides ip address generation and prefix utilities. """ diff --git a/daemon/core/nodes/lxd.py b/daemon/core/nodes/lxd.py index 9d5dedc4..164fe5f7 100644 --- a/daemon/core/nodes/lxd.py +++ b/daemon/core/nodes/lxd.py @@ -10,7 +10,7 @@ from core.errors import CoreCommandError from core.nodes.base import CoreNode -class LxdClient(object): +class LxdClient: def __init__(self, name, image, run): self.name = name self.image = image diff --git a/daemon/core/nodes/netclient.py b/daemon/core/nodes/netclient.py index 8bd58be7..b201493f 100644 --- a/daemon/core/nodes/netclient.py +++ b/daemon/core/nodes/netclient.py @@ -19,7 +19,7 @@ def get_net_client(use_ovs, run): return LinuxNetClient(run) -class LinuxNetClient(object): +class LinuxNetClient: """ Client for creating Linux bridges and ip interfaces for nodes. """ diff --git a/daemon/core/nodes/network.py b/daemon/core/nodes/network.py index 0a5a0b7b..1654a4a6 100644 --- a/daemon/core/nodes/network.py +++ b/daemon/core/nodes/network.py @@ -21,7 +21,7 @@ from core.nodes.netclient import get_net_client ebtables_lock = threading.Lock() -class EbtablesQueue(object): +class EbtablesQueue: """ Helper class for queuing up ebtables commands into rate-limited atomic commits. This improves performance and reliability when there are diff --git a/daemon/core/plugins/sdt.py b/daemon/core/plugins/sdt.py index 280a2bc2..410bba9d 100644 --- a/daemon/core/plugins/sdt.py +++ b/daemon/core/plugins/sdt.py @@ -24,7 +24,7 @@ from core.nodes.network import WlanNode # TODO: A named tuple may be more appropriate, than abusing a class dict like this -class Bunch(object): +class Bunch: """ Helper class for recording a collection of attributes. """ @@ -38,7 +38,7 @@ class Bunch(object): self.__dict__.update(kwargs) -class Sdt(object): +class Sdt: """ Helper class for exporting session objects to NRL"s SDT3D. The connect() method initializes the display, and can be invoked diff --git a/daemon/core/services/coreservices.py b/daemon/core/services/coreservices.py index 20553eb1..2a4cb178 100644 --- a/daemon/core/services/coreservices.py +++ b/daemon/core/services/coreservices.py @@ -29,7 +29,7 @@ class ServiceMode(enum.Enum): TIMER = 2 -class ServiceDependencies(object): +class ServiceDependencies: """ Can generate boot paths for services, based on their dependencies. Will validate that all services will be booted and that all dependencies exist within the services provided. @@ -127,7 +127,7 @@ class ServiceDependencies(object): return self.path -class ServiceShim(object): +class ServiceShim: keys = [ "dirs", "files", @@ -235,7 +235,7 @@ class ServiceShim(object): return servicesstring[1].split(",") -class ServiceManager(object): +class ServiceManager: """ Manages services available for CORE nodes to use. """ @@ -306,7 +306,7 @@ class ServiceManager(object): return service_errors -class CoreServices(object): +class CoreServices: """ Class for interacting with a list of available startup services for nodes. Mostly used to convert a CoreService into a Config API @@ -791,7 +791,7 @@ class CoreServices(object): node.nodefile(file_name, cfg) -class CoreService(object): +class CoreService: """ Parent class used for defining services. """ diff --git a/daemon/core/xml/corexml.py b/daemon/core/xml/corexml.py index 8b9df329..b813c0d8 100644 --- a/daemon/core/xml/corexml.py +++ b/daemon/core/xml/corexml.py @@ -104,7 +104,7 @@ def add_configuration(parent, name, value): add_attribute(config_element, "value", value) -class NodeElement(object): +class NodeElement: def __init__(self, session, node, element_name): self.session = session self.node = node @@ -131,7 +131,7 @@ class NodeElement(object): add_attribute(position, "alt", alt) -class ServiceElement(object): +class ServiceElement: def __init__(self, service): self.service = service self.element = etree.Element("service") @@ -232,7 +232,7 @@ class NetworkElement(NodeElement): add_attribute(self.element, "type", node_type) -class CoreXmlWriter(object): +class CoreXmlWriter: def __init__(self, session): self.session = session self.scenario = etree.Element("scenario") @@ -527,7 +527,7 @@ class CoreXmlWriter(object): return link_element -class CoreXmlReader(object): +class CoreXmlReader: def __init__(self, session): self.session = session self.scenario = None diff --git a/daemon/core/xml/corexmldeployment.py b/daemon/core/xml/corexmldeployment.py index 83bf3333..ec6759e8 100644 --- a/daemon/core/xml/corexmldeployment.py +++ b/daemon/core/xml/corexmldeployment.py @@ -84,7 +84,7 @@ def get_ipv4_addresses(hostname): raise NotImplementedError -class CoreXmlDeployment(object): +class CoreXmlDeployment: def __init__(self, session, scenario): self.session = session self.scenario = scenario diff --git a/daemon/scripts/core-manage b/daemon/scripts/core-manage index d9b9de08..14e10e5b 100755 --- a/daemon/scripts/core-manage +++ b/daemon/scripts/core-manage @@ -14,7 +14,7 @@ from core import services from core.constants import CORE_CONF_DIR -class FileUpdater(object): +class FileUpdater: """ Helper class for changing configuration files. """ diff --git a/daemon/tests/conftest.py b/daemon/tests/conftest.py index 521a2432..f8949299 100644 --- a/daemon/tests/conftest.py +++ b/daemon/tests/conftest.py @@ -23,7 +23,7 @@ from core.services.coreservices import ServiceManager EMANE_SERVICES = "zebra|OSPFv3MDR|IPForward" -class CoreServerTest(object): +class CoreServerTest: def __init__(self, port=CORE_API_PORT): self.host = "localhost" self.port = port