hacking: enable H238 (old style class declaration, use new style)
The rule was added in hacking 0.10 and is useful for migration to Python 3. Change-Id: I8b45413cf34e5a9db8074f9029410e3b22a92640
This commit is contained in:
parent
967d458981
commit
548ab45a50
@ -75,7 +75,7 @@ def _ofport_retry(fn):
|
||||
return wrapped
|
||||
|
||||
|
||||
class VifPort:
|
||||
class VifPort(object):
|
||||
def __init__(self, port_name, ofport, vif_id, vif_mac, switch):
|
||||
self.port_name = port_name
|
||||
self.ofport = ofport
|
||||
|
@ -34,7 +34,7 @@ DEVICE_OWNER_NETWORK_PROBE = 'network:probe'
|
||||
DEVICE_OWNER_COMPUTE_PROBE = 'compute:probe'
|
||||
|
||||
|
||||
class NeutronDebugAgent():
|
||||
class NeutronDebugAgent(object):
|
||||
|
||||
OPTS = [
|
||||
# Needed for drivers
|
||||
|
@ -44,7 +44,7 @@ EXTENDED_ATTRIBUTES_2_0 = {
|
||||
}
|
||||
|
||||
|
||||
class Extraroute():
|
||||
class Extraroute(object):
|
||||
|
||||
@classmethod
|
||||
def get_name(cls):
|
||||
|
@ -21,7 +21,7 @@ Neutron network life-cycle management.
|
||||
"""
|
||||
|
||||
|
||||
class NOSdriver():
|
||||
class NOSdriver(object):
|
||||
"""NOS NETCONF interface driver for Neutron network.
|
||||
|
||||
Fake: Handles life-cycle management of Neutron network,
|
||||
|
@ -40,7 +40,7 @@ def nos_unknown_host_cb(host, fingerprint):
|
||||
return True
|
||||
|
||||
|
||||
class NOSdriver():
|
||||
class NOSdriver(object):
|
||||
"""NOS NETCONF interface driver for Neutron network.
|
||||
|
||||
Handles life-cycle management of Neutron network (leverages AMPP on NOS)
|
||||
|
@ -106,7 +106,7 @@ class CiscoRoutingPluginApi(object):
|
||||
router_ids=router_ids, hosting_device_ids=hd_ids)
|
||||
|
||||
|
||||
class RoutingServiceHelper():
|
||||
class RoutingServiceHelper(object):
|
||||
|
||||
def __init__(self, host, conf, cfg_agent):
|
||||
self.conf = conf
|
||||
|
@ -106,7 +106,7 @@ device_dictionary = {}
|
||||
first_device_ip = None
|
||||
|
||||
|
||||
class CiscoConfigOptions():
|
||||
class CiscoConfigOptions(object):
|
||||
"""Cisco Configuration Options Class."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -23,7 +23,7 @@ UTIF_LIMIT = 7
|
||||
QUEUE_TIMEOUT = 300
|
||||
|
||||
|
||||
class Status:
|
||||
class Status(object):
|
||||
# Transient
|
||||
CREATING = constants.PENDING_CREATE
|
||||
UPDATING = constants.PENDING_UPDATE
|
||||
@ -35,7 +35,7 @@ class Status:
|
||||
DELETED = "DELETED" # not visible
|
||||
|
||||
|
||||
class Events:
|
||||
class Events(object):
|
||||
CREATE_ROUTER = "create_router"
|
||||
UPDATE_ROUTER = "update_router"
|
||||
DELETE_ROUTER = "delete_router"
|
||||
|
@ -23,7 +23,7 @@ LOG = logging.getLogger(__name__)
|
||||
HTTP_OK = 200
|
||||
|
||||
|
||||
class FakeClient():
|
||||
class FakeClient(object):
|
||||
|
||||
'''Fake Client for SDNVE controller.'''
|
||||
|
||||
|
@ -43,7 +43,7 @@ from neutron.plugins.ibm import sdnve_api_fake as sdnve_fake
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SdnveRpcCallbacks():
|
||||
class SdnveRpcCallbacks(object):
|
||||
|
||||
def __init__(self, notifier):
|
||||
self.notifier = notifier # used to notify the agent
|
||||
|
@ -60,14 +60,14 @@ BRIDGE_PORT_FS_FOR_DEVICE = BRIDGE_FS + DEVICE_NAME_PLACEHOLDER + "/brport"
|
||||
VXLAN_INTERFACE_PREFIX = "vxlan-"
|
||||
|
||||
|
||||
class NetworkSegment:
|
||||
class NetworkSegment(object):
|
||||
def __init__(self, network_type, physical_network, segmentation_id):
|
||||
self.network_type = network_type
|
||||
self.physical_network = physical_network
|
||||
self.segmentation_id = segmentation_id
|
||||
|
||||
|
||||
class LinuxBridgeManager:
|
||||
class LinuxBridgeManager(object):
|
||||
def __init__(self, interface_mappings, root_helper):
|
||||
self.interface_mappings = interface_mappings
|
||||
self.root_helper = root_helper
|
||||
|
@ -44,7 +44,7 @@ class MidonetApiException(n_exc.NeutronException):
|
||||
message = _("MidoNet API error: %(msg)s")
|
||||
|
||||
|
||||
class MidoClient:
|
||||
class MidoClient(object):
|
||||
|
||||
def __init__(self, mido_api):
|
||||
self.mido_api = mido_api
|
||||
|
@ -41,7 +41,7 @@ def nos_unknown_host_cb(host, fingerprint):
|
||||
return True
|
||||
|
||||
|
||||
class NOSdriver():
|
||||
class NOSdriver(object):
|
||||
"""NOS NETCONF interface driver for Neutron network.
|
||||
|
||||
Handles life-cycle management of Neutron network (leverages AMPP on NOS)
|
||||
|
@ -60,7 +60,7 @@ cfg.CONF.import_group('AGENT', 'neutron.plugins.ofagent.common.config')
|
||||
|
||||
# A class to represent a VIF (i.e., a port that has 'iface-id' and 'vif-mac'
|
||||
# attributes set).
|
||||
class LocalVLANMapping:
|
||||
class LocalVLANMapping(object):
|
||||
def __init__(self, vlan, network_type, physical_network, segmentation_id,
|
||||
vif_ports=None):
|
||||
assert(isinstance(vlan, (int, long)))
|
||||
|
@ -30,7 +30,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
# A class to represent a DVR-hosted subnet including vif_ports resident on
|
||||
# that subnet
|
||||
class LocalDVRSubnetMapping:
|
||||
class LocalDVRSubnetMapping(object):
|
||||
def __init__(self, subnet, csnat_ofport=constants.OFPORT_INVALID):
|
||||
# set of commpute ports on on this dvr subnet
|
||||
self.compute_ports = {}
|
||||
@ -72,7 +72,7 @@ class LocalDVRSubnetMapping:
|
||||
return self.csnat_ofport
|
||||
|
||||
|
||||
class OVSPort:
|
||||
class OVSPort(object):
|
||||
def __init__(self, id, ofport, mac, device_owner):
|
||||
self.id = id
|
||||
self.mac = mac
|
||||
|
@ -63,7 +63,7 @@ class DeviceListRetrievalError(exceptions.NeutronException):
|
||||
|
||||
# A class to represent a VIF (i.e., a port that has 'iface-id' and 'vif-mac'
|
||||
# attributes set).
|
||||
class LocalVLANMapping:
|
||||
class LocalVLANMapping(object):
|
||||
def __init__(self, vlan, network_type, physical_network, segmentation_id,
|
||||
vif_ports=None):
|
||||
if vif_ports is None:
|
||||
|
@ -19,7 +19,7 @@ from neutron.openstack.common import log as logging
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Plumlib():
|
||||
class Plumlib(object):
|
||||
"""
|
||||
Class PLUMgrid Fake Library. This library is a by-pass implementation
|
||||
for the PLUMgrid Library. This class is being used by the unit test
|
||||
|
@ -36,7 +36,7 @@ class PciDeviceIPWrapper(ip_lib.IPWrapper):
|
||||
VF_LINE_FORMAT = VF_PATTERN + MAC_PATTERN + ANY_PATTERN + STATE_PATTERN
|
||||
VF_DETAILS_REG_EX = re.compile(VF_LINE_FORMAT)
|
||||
|
||||
class LinkState:
|
||||
class LinkState(object):
|
||||
ENABLE = "enable"
|
||||
DISABLE = "disable"
|
||||
|
||||
|
@ -17,18 +17,18 @@ from oslo.config import cfg
|
||||
from neutron.plugins.vmware.common import exceptions as nsx_exc
|
||||
|
||||
|
||||
class AgentModes:
|
||||
class AgentModes(object):
|
||||
AGENT = 'agent'
|
||||
AGENTLESS = 'agentless'
|
||||
COMBINED = 'combined'
|
||||
|
||||
|
||||
class MetadataModes:
|
||||
class MetadataModes(object):
|
||||
DIRECT = 'access_network'
|
||||
INDIRECT = 'dhcp_host_route'
|
||||
|
||||
|
||||
class ReplicationModes:
|
||||
class ReplicationModes(object):
|
||||
SERVICE = 'service'
|
||||
SOURCE = 'source'
|
||||
|
||||
|
@ -165,7 +165,7 @@ class NsxCache(object):
|
||||
self._get_resource_ids(self._lswitchports, changed_only=True))
|
||||
|
||||
|
||||
class SyncParameters():
|
||||
class SyncParameters(object):
|
||||
"""Defines attributes used by the synchronization procedure.
|
||||
|
||||
chunk_size: Actual chunk size
|
||||
@ -203,7 +203,7 @@ def _start_loopingcall(min_chunk_size, state_sync_interval, func):
|
||||
return state_synchronizer
|
||||
|
||||
|
||||
class NsxSynchronizer():
|
||||
class NsxSynchronizer(object):
|
||||
|
||||
LS_URI = nsxlib._build_uri_path(
|
||||
switchlib.LSWITCH_RESOURCE, fields='uuid,tags,fabric_status',
|
||||
|
@ -26,7 +26,7 @@ NEUTRON_VERSION = version.version_info.release_string()
|
||||
|
||||
|
||||
# Allowed network types for the NSX Plugin
|
||||
class NetworkTypes:
|
||||
class NetworkTypes(object):
|
||||
"""Allowed provider network types for the NSX Plugin."""
|
||||
L3_EXT = 'l3_ext'
|
||||
STT = 'stt'
|
||||
|
@ -51,7 +51,7 @@ class TaskStateSkipped(TaskException):
|
||||
message = _("State %(state)d skipped. Current state %(current)d")
|
||||
|
||||
|
||||
class Task():
|
||||
class Task(object):
|
||||
def __init__(self, name, resource_id, execute_callback,
|
||||
status_callback=nop, result_callback=nop, userdata=None):
|
||||
self.name = name
|
||||
@ -147,7 +147,7 @@ class Task():
|
||||
self.name, self.resource_id, self.id)
|
||||
|
||||
|
||||
class TaskManager():
|
||||
class TaskManager(object):
|
||||
|
||||
_instance = None
|
||||
_default_interval = DEFAULT_INTERVAL
|
||||
|
@ -20,7 +20,7 @@ from neutron.plugins.bigswitch import servermanager
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class HTTPResponseMock():
|
||||
class HTTPResponseMock(object):
|
||||
status = 200
|
||||
reason = 'OK'
|
||||
|
||||
|
@ -119,7 +119,7 @@ def get_subnet_mock(bridge_id=None, gateway_ip='10.0.0.1',
|
||||
return subnet
|
||||
|
||||
|
||||
class MidonetLibMockConfig():
|
||||
class MidonetLibMockConfig(object):
|
||||
|
||||
def __init__(self, inst):
|
||||
self.inst = inst
|
||||
@ -169,7 +169,7 @@ class MidonetLibMockConfig():
|
||||
self.inst.get_router.side_effect = self._get_router
|
||||
|
||||
|
||||
class MidoClientMockConfig():
|
||||
class MidoClientMockConfig(object):
|
||||
|
||||
def __init__(self, inst):
|
||||
self.inst = inst
|
||||
|
@ -23,7 +23,7 @@ import neutron.plugins.midonet.agent.midonet_driver as driver
|
||||
from neutron.tests import base
|
||||
|
||||
|
||||
class FakeNetwork:
|
||||
class FakeNetwork(object):
|
||||
id = 'aaaabbbb-cccc-dddd-eeee-ffff00001111'
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
@ -364,7 +364,7 @@ class PFCV5DriverTest(PFCDriverTestBase):
|
||||
self.assertEqual(data['routes'], expected)
|
||||
|
||||
|
||||
class PFCFilterDriverTestMixin:
|
||||
class PFCFilterDriverTestMixin(object):
|
||||
def _test_create_filter(self, filter_dict=None, filter_post=None,
|
||||
apply_ports=None):
|
||||
t, n, p = self.get_ofc_item_random_params()
|
||||
|
@ -55,12 +55,12 @@ BCAST_MAC = "01:00:00:00:00:00/01:00:00:00:00:00"
|
||||
UCAST_MAC = "00:00:00:00:00:00/01:00:00:00:00:00"
|
||||
|
||||
|
||||
class DummyPort:
|
||||
class DummyPort(object):
|
||||
def __init__(self, interface_id):
|
||||
self.interface_id = interface_id
|
||||
|
||||
|
||||
class DummyVlanBinding:
|
||||
class DummyVlanBinding(object):
|
||||
def __init__(self, network_id, vlan_id):
|
||||
self.network_id = network_id
|
||||
self.vlan_id = vlan_id
|
||||
|
@ -1437,7 +1437,7 @@ class ExtensionTestCase(base.BaseTestCase, testlib_plugin.PluginSetupHelper):
|
||||
self.assertNotIn('v2attrs:something_else', net)
|
||||
|
||||
|
||||
class TestSubresourcePlugin():
|
||||
class TestSubresourcePlugin(object):
|
||||
def get_network_dummies(self, context, network_id,
|
||||
filters=None, fields=None):
|
||||
return []
|
||||
|
@ -339,7 +339,7 @@ class TestDhcpAgent(base.BaseTestCase):
|
||||
self._test_sync_state_helper(['b'], ['a'])
|
||||
|
||||
def test_sync_state_waitall(self):
|
||||
class mockNetwork():
|
||||
class mockNetwork(object):
|
||||
id = '0'
|
||||
admin_state_up = True
|
||||
subnets = []
|
||||
@ -1121,11 +1121,11 @@ class TestNetworkCache(base.BaseTestCase):
|
||||
self.assertEqual(nc.get_port_by_id(fake_port1.id), fake_port1)
|
||||
|
||||
|
||||
class FakePort1:
|
||||
class FakePort1(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
|
||||
|
||||
class FakeV4Subnet:
|
||||
class FakeV4Subnet(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
ip_version = 4
|
||||
cidr = '192.168.0.0/24'
|
||||
@ -1133,7 +1133,7 @@ class FakeV4Subnet:
|
||||
enable_dhcp = True
|
||||
|
||||
|
||||
class FakeV4SubnetNoGateway:
|
||||
class FakeV4SubnetNoGateway(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
ip_version = 4
|
||||
cidr = '192.168.1.0/24'
|
||||
@ -1141,20 +1141,20 @@ class FakeV4SubnetNoGateway:
|
||||
enable_dhcp = True
|
||||
|
||||
|
||||
class FakeV4Network:
|
||||
class FakeV4Network(object):
|
||||
id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||
subnets = [FakeV4Subnet()]
|
||||
ports = [FakePort1()]
|
||||
namespace = 'qdhcp-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||
|
||||
|
||||
class FakeV4NetworkNoSubnet:
|
||||
class FakeV4NetworkNoSubnet(object):
|
||||
id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||
subnets = []
|
||||
ports = []
|
||||
|
||||
|
||||
class FakeV4NetworkNoGateway:
|
||||
class FakeV4NetworkNoGateway(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4SubnetNoGateway()]
|
||||
ports = [FakePort1()]
|
||||
|
@ -31,7 +31,7 @@ from neutron.tests import base
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FakeIPAllocation:
|
||||
class FakeIPAllocation(object):
|
||||
def __init__(self, address, subnet_id=None):
|
||||
self.ip_address = address
|
||||
self.subnet_id = subnet_id
|
||||
@ -45,7 +45,7 @@ class DhcpOpt(object):
|
||||
return str(self.__dict__)
|
||||
|
||||
|
||||
class FakePort1:
|
||||
class FakePort1(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
admin_state_up = True
|
||||
device_owner = 'foo1'
|
||||
@ -57,7 +57,7 @@ class FakePort1:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakePort2:
|
||||
class FakePort2(object):
|
||||
id = 'ffffffff-ffff-ffff-ffff-ffffffffffff'
|
||||
admin_state_up = False
|
||||
device_owner = 'foo2'
|
||||
@ -69,7 +69,7 @@ class FakePort2:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakePort3:
|
||||
class FakePort3(object):
|
||||
id = '44444444-4444-4444-4444-444444444444'
|
||||
admin_state_up = True
|
||||
device_owner = 'foo3'
|
||||
@ -83,7 +83,7 @@ class FakePort3:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakePort4:
|
||||
class FakePort4(object):
|
||||
|
||||
id = 'gggggggg-gggg-gggg-gggg-gggggggggggg'
|
||||
admin_state_up = False
|
||||
@ -98,7 +98,7 @@ class FakePort4:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakeV6Port:
|
||||
class FakeV6Port(object):
|
||||
id = 'hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh'
|
||||
admin_state_up = True
|
||||
device_owner = 'foo3'
|
||||
@ -110,7 +110,7 @@ class FakeV6Port:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakeDualPort:
|
||||
class FakeDualPort(object):
|
||||
id = 'hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh'
|
||||
admin_state_up = True
|
||||
device_owner = 'foo3'
|
||||
@ -124,7 +124,7 @@ class FakeDualPort:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakeRouterPort:
|
||||
class FakeRouterPort(object):
|
||||
id = 'rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr'
|
||||
admin_state_up = True
|
||||
device_owner = constants.DEVICE_OWNER_ROUTER_INTF
|
||||
@ -138,7 +138,7 @@ class FakeRouterPort:
|
||||
ip_address, 'dddddddd-dddd-dddd-dddd-dddddddddddd')]
|
||||
|
||||
|
||||
class FakePortMultipleAgents1:
|
||||
class FakePortMultipleAgents1(object):
|
||||
id = 'rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr'
|
||||
admin_state_up = True
|
||||
device_owner = constants.DEVICE_OWNER_DHCP
|
||||
@ -150,7 +150,7 @@ class FakePortMultipleAgents1:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakePortMultipleAgents2:
|
||||
class FakePortMultipleAgents2(object):
|
||||
id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||
admin_state_up = True
|
||||
device_owner = constants.DEVICE_OWNER_DHCP
|
||||
@ -162,22 +162,22 @@ class FakePortMultipleAgents2:
|
||||
self.extra_dhcp_opts = []
|
||||
|
||||
|
||||
class FakeV4HostRoute:
|
||||
class FakeV4HostRoute(object):
|
||||
destination = '20.0.0.1/24'
|
||||
nexthop = '20.0.0.1'
|
||||
|
||||
|
||||
class FakeV4HostRouteGateway:
|
||||
class FakeV4HostRouteGateway(object):
|
||||
destination = '0.0.0.0/0'
|
||||
nexthop = '10.0.0.1'
|
||||
|
||||
|
||||
class FakeV6HostRoute:
|
||||
class FakeV6HostRoute(object):
|
||||
destination = '2001:0200:feed:7ac0::/64'
|
||||
nexthop = '2001:0200:feed:7ac0::1'
|
||||
|
||||
|
||||
class FakeV4Subnet:
|
||||
class FakeV4Subnet(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
ip_version = 4
|
||||
cidr = '192.168.0.0/24'
|
||||
@ -187,7 +187,7 @@ class FakeV4Subnet:
|
||||
dns_nameservers = ['8.8.8.8']
|
||||
|
||||
|
||||
class FakeV4MetadataSubnet:
|
||||
class FakeV4MetadataSubnet(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
ip_version = 4
|
||||
cidr = '169.254.169.254/30'
|
||||
@ -197,7 +197,7 @@ class FakeV4MetadataSubnet:
|
||||
dns_nameservers = []
|
||||
|
||||
|
||||
class FakeV4SubnetGatewayRoute:
|
||||
class FakeV4SubnetGatewayRoute(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
ip_version = 4
|
||||
cidr = '192.168.0.0/24'
|
||||
@ -207,7 +207,7 @@ class FakeV4SubnetGatewayRoute:
|
||||
dns_nameservers = ['8.8.8.8']
|
||||
|
||||
|
||||
class FakeV4SubnetMultipleAgentsWithoutDnsProvided:
|
||||
class FakeV4SubnetMultipleAgentsWithoutDnsProvided(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
ip_version = 4
|
||||
cidr = '192.168.0.0/24'
|
||||
@ -217,7 +217,7 @@ class FakeV4SubnetMultipleAgentsWithoutDnsProvided:
|
||||
host_routes = []
|
||||
|
||||
|
||||
class FakeV4MultipleAgentsWithoutDnsProvided:
|
||||
class FakeV4MultipleAgentsWithoutDnsProvided(object):
|
||||
id = 'ffffffff-ffff-ffff-ffff-ffffffffffff'
|
||||
subnets = [FakeV4SubnetMultipleAgentsWithoutDnsProvided()]
|
||||
ports = [FakePort1(), FakePort2(), FakePort3(), FakeRouterPort(),
|
||||
@ -225,7 +225,7 @@ class FakeV4MultipleAgentsWithoutDnsProvided:
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeV4SubnetMultipleAgentsWithDnsProvided:
|
||||
class FakeV4SubnetMultipleAgentsWithDnsProvided(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
ip_version = 4
|
||||
cidr = '192.168.0.0/24'
|
||||
@ -235,7 +235,7 @@ class FakeV4SubnetMultipleAgentsWithDnsProvided:
|
||||
host_routes = []
|
||||
|
||||
|
||||
class FakeV4MultipleAgentsWithDnsProvided:
|
||||
class FakeV4MultipleAgentsWithDnsProvided(object):
|
||||
id = 'ffffffff-ffff-ffff-ffff-ffffffffffff'
|
||||
subnets = [FakeV4SubnetMultipleAgentsWithDnsProvided()]
|
||||
ports = [FakePort1(), FakePort2(), FakePort3(), FakeRouterPort(),
|
||||
@ -243,7 +243,7 @@ class FakeV4MultipleAgentsWithDnsProvided:
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeV6Subnet:
|
||||
class FakeV6Subnet(object):
|
||||
id = 'ffffffff-ffff-ffff-ffff-ffffffffffff'
|
||||
ip_version = 6
|
||||
cidr = 'fdca:3ba5:a17a:4ba3::/64'
|
||||
@ -255,7 +255,7 @@ class FakeV6Subnet:
|
||||
ipv6_address_mode = None
|
||||
|
||||
|
||||
class FakeV4SubnetNoDHCP:
|
||||
class FakeV4SubnetNoDHCP(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
ip_version = 4
|
||||
cidr = '192.168.1.0/24'
|
||||
@ -265,7 +265,7 @@ class FakeV4SubnetNoDHCP:
|
||||
dns_nameservers = []
|
||||
|
||||
|
||||
class FakeV6SubnetDHCPStateful:
|
||||
class FakeV6SubnetDHCPStateful(object):
|
||||
id = 'ffffffff-ffff-ffff-ffff-ffffffffffff'
|
||||
ip_version = 6
|
||||
cidr = 'fdca:3ba5:a17a:4ba3::/64'
|
||||
@ -277,7 +277,7 @@ class FakeV6SubnetDHCPStateful:
|
||||
ipv6_address_mode = constants.DHCPV6_STATEFUL
|
||||
|
||||
|
||||
class FakeV6SubnetSlaac:
|
||||
class FakeV6SubnetSlaac(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
ip_version = 6
|
||||
cidr = 'ffda:3ba5:a17a:4ba3::/64'
|
||||
@ -288,7 +288,7 @@ class FakeV6SubnetSlaac:
|
||||
ipv6_ra_mode = None
|
||||
|
||||
|
||||
class FakeV4SubnetNoGateway:
|
||||
class FakeV4SubnetNoGateway(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
ip_version = 4
|
||||
cidr = '192.168.1.0/24'
|
||||
@ -298,7 +298,7 @@ class FakeV4SubnetNoGateway:
|
||||
dns_nameservers = []
|
||||
|
||||
|
||||
class FakeV4SubnetNoRouter:
|
||||
class FakeV4SubnetNoRouter(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
ip_version = 4
|
||||
cidr = '192.168.1.0/24'
|
||||
@ -308,67 +308,67 @@ class FakeV4SubnetNoRouter:
|
||||
dns_nameservers = []
|
||||
|
||||
|
||||
class FakeV4Network:
|
||||
class FakeV4Network(object):
|
||||
id = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||
subnets = [FakeV4Subnet()]
|
||||
ports = [FakePort1()]
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeV6Network:
|
||||
class FakeV6Network(object):
|
||||
id = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'
|
||||
subnets = [FakeV6Subnet()]
|
||||
ports = [FakePort2()]
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeDualNetwork:
|
||||
class FakeDualNetwork(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4Subnet(), FakeV6SubnetDHCPStateful()]
|
||||
ports = [FakePort1(), FakeV6Port(), FakeDualPort(), FakeRouterPort()]
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeDualNetworkGatewayRoute:
|
||||
class FakeDualNetworkGatewayRoute(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4SubnetGatewayRoute(), FakeV6SubnetDHCPStateful()]
|
||||
ports = [FakePort1(), FakePort2(), FakePort3(), FakeRouterPort()]
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeDualNetworkSingleDHCP:
|
||||
class FakeDualNetworkSingleDHCP(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4Subnet(), FakeV4SubnetNoDHCP()]
|
||||
ports = [FakePort1(), FakePort2(), FakePort3(), FakeRouterPort()]
|
||||
namespace = 'qdhcp-ns'
|
||||
|
||||
|
||||
class FakeV4NoGatewayNetwork:
|
||||
class FakeV4NoGatewayNetwork(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4SubnetNoGateway()]
|
||||
ports = [FakePort1()]
|
||||
|
||||
|
||||
class FakeV4NetworkNoRouter:
|
||||
class FakeV4NetworkNoRouter(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4SubnetNoRouter()]
|
||||
ports = [FakePort1()]
|
||||
|
||||
|
||||
class FakeV4MetadataNetwork:
|
||||
class FakeV4MetadataNetwork(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4MetadataSubnet()]
|
||||
ports = [FakeRouterPort(ip_address='169.254.169.253')]
|
||||
|
||||
|
||||
class FakeV4NetworkDistRouter:
|
||||
class FakeV4NetworkDistRouter(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4Subnet()]
|
||||
ports = [FakePort1(),
|
||||
FakeRouterPort(dev_owner=constants.DEVICE_OWNER_DVR_INTERFACE)]
|
||||
|
||||
|
||||
class FakeDualV4Pxe3Ports:
|
||||
class FakeDualV4Pxe3Ports(object):
|
||||
id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
subnets = [FakeV4Subnet(), FakeV4SubnetNoDHCP()]
|
||||
ports = [FakePort1(), FakePort2(), FakePort3(), FakeRouterPort()]
|
||||
@ -403,7 +403,7 @@ class FakeDualV4Pxe3Ports:
|
||||
DhcpOpt(opt_name='bootfile-name', opt_value='pxelinux3.0')]
|
||||
|
||||
|
||||
class FakeV4NetworkPxe2Ports:
|
||||
class FakeV4NetworkPxe2Ports(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
subnets = [FakeV4Subnet()]
|
||||
ports = [FakePort1(), FakePort2(), FakeRouterPort()]
|
||||
@ -430,7 +430,7 @@ class FakeV4NetworkPxe2Ports:
|
||||
DhcpOpt(opt_name='bootfile-name', opt_value='pxelinux.0')]
|
||||
|
||||
|
||||
class FakeV4NetworkPxe3Ports:
|
||||
class FakeV4NetworkPxe3Ports(object):
|
||||
id = 'dddddddd-dddd-dddd-dddd-dddddddddddd'
|
||||
subnets = [FakeV4Subnet()]
|
||||
ports = [FakePort1(), FakePort2(), FakePort3(), FakeRouterPort()]
|
||||
@ -465,7 +465,7 @@ class FakeV4NetworkPxe3Ports:
|
||||
DhcpOpt(opt_name='bootfile-name', opt_value='pxelinux3.0')]
|
||||
|
||||
|
||||
class FakeDualStackNetworkSingleDHCP:
|
||||
class FakeDualStackNetworkSingleDHCP(object):
|
||||
id = 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee'
|
||||
|
||||
subnets = [FakeV4Subnet(), FakeV6SubnetSlaac()]
|
||||
|
@ -34,21 +34,21 @@ class BaseChild(interface.LinuxInterfaceDriver):
|
||||
pass
|
||||
|
||||
|
||||
class FakeNetwork:
|
||||
class FakeNetwork(object):
|
||||
id = '12345678-1234-5678-90ab-ba0987654321'
|
||||
|
||||
|
||||
class FakeSubnet:
|
||||
class FakeSubnet(object):
|
||||
cidr = '192.168.1.1/24'
|
||||
|
||||
|
||||
class FakeAllocation:
|
||||
class FakeAllocation(object):
|
||||
subnet = FakeSubnet()
|
||||
ip_address = '192.168.1.2'
|
||||
ip_version = 4
|
||||
|
||||
|
||||
class FakePort:
|
||||
class FakePort(object):
|
||||
id = 'abcdef01-1234-5678-90ab-ba0987654321'
|
||||
fixed_ips = [FakeAllocation]
|
||||
device_id = 'cccccccc-cccc-cccc-cccc-cccccccccccc'
|
||||
|
@ -2839,7 +2839,7 @@ class TestSecurityGroupAgentEnhancedIpsetWithIptables(
|
||||
self._verify_mock_calls()
|
||||
|
||||
|
||||
class SGNotificationTestMixin():
|
||||
class SGNotificationTestMixin(object):
|
||||
def test_security_group_rule_updated(self):
|
||||
name = 'webservers'
|
||||
description = 'my webservers'
|
||||
|
@ -613,7 +613,7 @@ class ResourceTest(base.BaseTestCase):
|
||||
def my_fault_body_function():
|
||||
return 'off'
|
||||
|
||||
class FakeRequest():
|
||||
class FakeRequest(object):
|
||||
def __init__(self):
|
||||
self.url = 'http://where.no'
|
||||
self.environ = 'environ'
|
||||
@ -653,7 +653,7 @@ class ResourceTest(base.BaseTestCase):
|
||||
def my_fault_body_function():
|
||||
return 'off'
|
||||
|
||||
class FakeRequest():
|
||||
class FakeRequest(object):
|
||||
def __init__(self):
|
||||
self.url = 'http://where.no'
|
||||
self.environ = 'environ'
|
||||
|
3
tox.ini
3
tox.ini
@ -75,11 +75,10 @@ commands = python setup.py build_sphinx
|
||||
# E128 continuation line under-indented for visual indent
|
||||
# E129 visually indented line with same indent as next logical line
|
||||
# E265 block comment should start with ‘# ‘
|
||||
# H238 old style class declaration, use new style
|
||||
# H305 imports not grouped correctly
|
||||
# H404 multi line docstring should start with a summary
|
||||
# H405 multi line docstring summary not separated with an empty line
|
||||
ignore = E125,E126,E128,E129,E265,H238,H305,H404,H405
|
||||
ignore = E125,E126,E128,E129,E265,H305,H404,H405
|
||||
show-source = true
|
||||
builtins = _
|
||||
# TODO(dougw) neutron/tests/unit/vmware exclusion is a temporary services split hack
|
||||
|
Loading…
Reference in New Issue
Block a user