summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nova/api/metadata/base.py2
-rw-r--r--nova/compute/resources/__init__.py2
-rw-r--r--nova/objects/base.py2
-rw-r--r--nova/objects/fields.py3
-rw-r--r--nova/tests/unit/api/openstack/fakes.py2
-rw-r--r--nova/tests/unit/api/openstack/test_wsgi.py2
-rw-r--r--nova/tests/unit/api/test_auth.py2
-rw-r--r--nova/tests/unit/fake_network.py2
-rw-r--r--nova/tests/unit/fake_volume.py6
-rw-r--r--nova/tests/unit/monkey_patch_example/example_a.py2
-rw-r--r--nova/tests/unit/monkey_patch_example/example_b.py2
-rw-r--r--nova/tests/unit/objects/test_fields.py2
-rw-r--r--nova/tests/unit/virt/libvirt/test_driver.py26
-rw-r--r--nova/tests/unit/virt/libvirt/test_firewall.py4
-rw-r--r--nova/tests/unit/virt/vmwareapi/stubs.py6
-rw-r--r--nova/tests/unit/virt/vmwareapi/test_vmops.py2
-rw-r--r--nova/tests/unit/virt/xenapi/test_agent.py2
-rw-r--r--nova/tests/unit/virt/xenapi/test_vm_utils.py2
-rw-r--r--nova/tests/unit/virt/xenapi/test_xenapi.py2
-rw-r--r--nova/virt/xenapi/fake.py2
-rw-r--r--tox.ini2
21 files changed, 39 insertions, 38 deletions
diff --git a/nova/api/metadata/base.py b/nova/api/metadata/base.py
index b042651f54..5e79903120 100644
--- a/nova/api/metadata/base.py
+++ b/nova/api/metadata/base.py
@@ -96,7 +96,7 @@ class InvalidMetadataPath(Exception):
pass
-class InstanceMetadata():
+class InstanceMetadata(object):
"""Instance metadata."""
def __init__(self, instance, address=None, content=None, extra_md=None,
diff --git a/nova/compute/resources/__init__.py b/nova/compute/resources/__init__.py
index e8ab37fc62..49b8032a59 100644
--- a/nova/compute/resources/__init__.py
+++ b/nova/compute/resources/__init__.py
@@ -23,7 +23,7 @@ LOG = logging.getLogger(__name__)
RESOURCE_NAMESPACE = 'nova.compute.resources'
-class ResourceHandler():
+class ResourceHandler(object):
def _log_missing_plugins(self, names):
for name in names:
diff --git a/nova/objects/base.py b/nova/objects/base.py
index 7d5f4406c1..7d3cdc09ad 100644
--- a/nova/objects/base.py
+++ b/nova/objects/base.py
@@ -39,7 +39,7 @@ from nova import utils
LOG = logging.getLogger('object')
-class NotSpecifiedSentinel:
+class NotSpecifiedSentinel(object):
pass
diff --git a/nova/objects/fields.py b/nova/objects/fields.py
index 26a1c0768b..87c9940885 100644
--- a/nova/objects/fields.py
+++ b/nova/objects/fields.py
@@ -46,7 +46,8 @@ class ElementTypeError(TypeError):
})
-class AbstractFieldType(six.with_metaclass(abc.ABCMeta, object)):
+@six.add_metaclass(abc.ABCMeta)
+class AbstractFieldType(object):
@abc.abstractmethod
def coerce(self, obj, attr, value):
"""This is called to coerce (if possible) a value on assignment.
diff --git a/nova/tests/unit/api/openstack/fakes.py b/nova/tests/unit/api/openstack/fakes.py
index e48d9da8d3..9976c38444 100644
--- a/nova/tests/unit/api/openstack/fakes.py
+++ b/nova/tests/unit/api/openstack/fakes.py
@@ -217,7 +217,7 @@ def stub_out_nw_api(stubs, cls=None, private=None, publics=None):
if not publics:
publics = ['1.2.3.4']
- class Fake:
+ class Fake(object):
def get_instance_nw_info(*args, **kwargs):
pass
diff --git a/nova/tests/unit/api/openstack/test_wsgi.py b/nova/tests/unit/api/openstack/test_wsgi.py
index 097faa6d8f..f356f800e3 100644
--- a/nova/tests/unit/api/openstack/test_wsgi.py
+++ b/nova/tests/unit/api/openstack/test_wsgi.py
@@ -503,7 +503,7 @@ class ResourceTest(test.NoDBTestCase):
'{"barAction": true}')
def test_get_method_action_method(self):
- class Controller():
+ class Controller(object):
def action(self, req, pants=None):
return pants
diff --git a/nova/tests/unit/api/test_auth.py b/nova/tests/unit/api/test_auth.py
index 0da727fef7..28f4c50d8d 100644
--- a/nova/tests/unit/api/test_auth.py
+++ b/nova/tests/unit/api/test_auth.py
@@ -138,7 +138,7 @@ class TestPipeLineFactory(test.NoDBTestCase):
def __init__(self, name):
self.name = name
- class FakeLoader():
+ class FakeLoader(object):
def get_filter(self, name):
return TestPipeLineFactory.FakeFilter(name)
diff --git a/nova/tests/unit/fake_network.py b/nova/tests/unit/fake_network.py
index 09f54b13d3..847ff783fc 100644
--- a/nova/tests/unit/fake_network.py
+++ b/nova/tests/unit/fake_network.py
@@ -50,7 +50,7 @@ class FakeNetworkManager(network_manager.NetworkManager):
inherited service cruft and just perform unit tests.
"""
- class FakeDB:
+ class FakeDB(object):
vifs = [{'id': 0,
'created_at': None,
'updated_at': None,
diff --git a/nova/tests/unit/fake_volume.py b/nova/tests/unit/fake_volume.py
index 6fbe560162..10c16094a2 100644
--- a/nova/tests/unit/fake_volume.py
+++ b/nova/tests/unit/fake_volume.py
@@ -29,7 +29,7 @@ CONF.import_opt('cross_az_attach',
'nova.volume.cinder', group='cinder')
-class fake_volume():
+class fake_volume(object):
user_uuid = '4a3cd440-b9c2-11e1-afa6-0800200c9a66'
instance_uuid = '4a3cd441-b9c2-11e1-afa6-0800200c9a66'
@@ -80,7 +80,7 @@ class fake_volume():
self.vol[key]
-class fake_snapshot():
+class fake_snapshot(object):
user_uuid = '4a3cd440-b9c2-11e1-afa6-0800200c9a66'
instance_uuid = '4a3cd441-b9c2-11e1-afa6-0800200c9a66'
@@ -119,7 +119,7 @@ class API(object):
snapshot_list = []
_instance = None
- class Singleton:
+ class Singleton(object):
def __init__(self):
self.API = None
diff --git a/nova/tests/unit/monkey_patch_example/example_a.py b/nova/tests/unit/monkey_patch_example/example_a.py
index 3fdb4dcc05..3844766ea7 100644
--- a/nova/tests/unit/monkey_patch_example/example_a.py
+++ b/nova/tests/unit/monkey_patch_example/example_a.py
@@ -19,7 +19,7 @@ def example_function_a():
return 'Example function'
-class ExampleClassA():
+class ExampleClassA(object):
def example_method(self):
return 'Example method'
diff --git a/nova/tests/unit/monkey_patch_example/example_b.py b/nova/tests/unit/monkey_patch_example/example_b.py
index 2515fd2be4..52803377fc 100644
--- a/nova/tests/unit/monkey_patch_example/example_b.py
+++ b/nova/tests/unit/monkey_patch_example/example_b.py
@@ -20,7 +20,7 @@ def example_function_b():
return 'Example function'
-class ExampleClassB():
+class ExampleClassB(object):
def example_method(self):
return 'Example method'
diff --git a/nova/tests/unit/objects/test_fields.py b/nova/tests/unit/objects/test_fields.py
index 78cd0d46f7..5cc52ce2a0 100644
--- a/nova/tests/unit/objects/test_fields.py
+++ b/nova/tests/unit/objects/test_fields.py
@@ -59,7 +59,7 @@ class TestField(test.NoDBTestCase):
in_val))
def test_from_primitive(self):
- class ObjectLikeThing:
+ class ObjectLikeThing(object):
_context = 'context'
for prim_val, out_val in self.from_primitive_values:
diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py
index c80f6d3d32..37780adaad 100644
--- a/nova/tests/unit/virt/libvirt/test_driver.py
+++ b/nova/tests/unit/virt/libvirt/test_driver.py
@@ -471,7 +471,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.stubs.Set(imagebackend.Image, 'resolve_driver_format',
imagebackend.Image._get_driver_format)
- class FakeConn():
+ class FakeConn(object):
def baselineCPU(self, cpu, flag):
"""Add new libvirt API."""
return """<cpu mode='custom' match='exact'>
@@ -718,7 +718,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
- class FakeDev():
+ class FakeDev(object):
def attach(self):
pass
@@ -743,7 +743,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.flags(virt_type='xen', group='libvirt')
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
- class FakeDev():
+ class FakeDev(object):
def attach(self):
pass
@@ -805,14 +805,14 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.mox.StubOutWithMock(libvirt_driver.LibvirtDriver,
'_get_guest_pci_device')
- class FakeDev():
+ class FakeDev(object):
def to_xml(self):
pass
libvirt_driver.LibvirtDriver._get_guest_pci_device =\
lambda x, y: FakeDev()
- class FakeDomain():
+ class FakeDomain(object):
def detachDeviceFlags(self, xml, flag):
pci_devices[0]['hypervisor_name'] = 'marked'
pass
@@ -849,14 +849,14 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.mox.StubOutWithMock(libvirt_driver.LibvirtDriver,
'_get_guest_pci_device')
- class FakeDev():
+ class FakeDev(object):
def to_xml(self):
pass
libvirt_driver.LibvirtDriver._get_guest_pci_device =\
lambda x, y: FakeDev()
- class FakeDomain():
+ class FakeDomain(object):
def detachDeviceFlags(self, xml, flag):
pass
@@ -6418,7 +6418,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
{'connection_info': 'dummy', 'mount_device': '/dev/sdb'}]}
conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)
- class FakeNetworkInfo():
+ class FakeNetworkInfo(object):
def fixed_ips(self):
return ["test_ip_addr"]
@@ -6488,7 +6488,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.stubs.Set(conn, '_create_images_and_backing', fake_none)
- class FakeNetworkInfo():
+ class FakeNetworkInfo(object):
def fixed_ips(self):
return ["test_ip_addr"]
inst_ref = objects.Instance(**self.test_instance)
@@ -7042,7 +7042,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
def fake_get_info(instance):
return hardware.InstanceInfo(state=power_state.RUNNING)
- class FakeLibvirtPciDevice():
+ class FakeLibvirtPciDevice(object):
def dettach(self):
return None
@@ -7692,7 +7692,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
None)
def test_reboot_different_ids(self):
- class FakeLoopingCall:
+ class FakeLoopingCall(object):
def start(self, *a, **k):
return self
@@ -7732,7 +7732,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.assertTrue(self.reboot_create_called)
def test_reboot_same_ids(self):
- class FakeLoopingCall:
+ class FakeLoopingCall(object):
def start(self, *a, **k):
return self
@@ -11364,7 +11364,7 @@ class LibvirtDriverTestCase(test.NoDBTestCase):
def _test_finish_revert_migration_after_crash(self, backup_made=True,
del_inst_failed=False):
- class FakeLoopingCall:
+ class FakeLoopingCall(object):
def start(self, *a, **k):
return self
diff --git a/nova/tests/unit/virt/libvirt/test_firewall.py b/nova/tests/unit/virt/libvirt/test_firewall.py
index c71d29c434..340920a647 100644
--- a/nova/tests/unit/virt/libvirt/test_firewall.py
+++ b/nova/tests/unit/virt/libvirt/test_firewall.py
@@ -44,7 +44,7 @@ _fake_stub_out_get_nw_info = fake_network.stub_out_nw_api_get_instance_nw_info
_ipv4_like = fake_network.ipv4_like
-class NWFilterFakes:
+class NWFilterFakes(object):
def __init__(self):
self.filters = {}
@@ -54,7 +54,7 @@ class NWFilterFakes:
raise libvirt.libvirtError('Filter Not Found')
def filterDefineXMLMock(self, xml):
- class FakeNWFilterInternal:
+ class FakeNWFilterInternal(object):
def __init__(self, parent, name, u, xml):
self.name = name
self.uuid = u
diff --git a/nova/tests/unit/virt/vmwareapi/stubs.py b/nova/tests/unit/virt/vmwareapi/stubs.py
index d126b36e0f..5c8e3f5467 100644
--- a/nova/tests/unit/virt/vmwareapi/stubs.py
+++ b/nova/tests/unit/virt/vmwareapi/stubs.py
@@ -104,11 +104,11 @@ def fake_suds_context(calls=None):
calls = calls or {}
- class fake_factory:
+ class fake_factory(object):
def create(self, name):
return mock.NonCallableMagicMock(name=name)
- class fake_service:
+ class fake_service(object):
def __getattr__(self, attr_name):
if attr_name in calls:
return calls[attr_name]
@@ -117,7 +117,7 @@ def fake_suds_context(calls=None):
calls[attr_name] = mock_call
return mock_call
- class fake_client:
+ class fake_client(object):
def __init__(self, wdsl_url, **kwargs):
self.service = fake_service()
self.factory = fake_factory()
diff --git a/nova/tests/unit/virt/vmwareapi/test_vmops.py b/nova/tests/unit/virt/vmwareapi/test_vmops.py
index 6e251c370d..9eb393fe04 100644
--- a/nova/tests/unit/virt/vmwareapi/test_vmops.py
+++ b/nova/tests/unit/virt/vmwareapi/test_vmops.py
@@ -40,7 +40,7 @@ from nova.virt.vmwareapi import vm_util
from nova.virt.vmwareapi import vmops
-class DsPathMatcher:
+class DsPathMatcher(object):
def __init__(self, expected_ds_path_str):
self.expected_ds_path_str = expected_ds_path_str
diff --git a/nova/tests/unit/virt/xenapi/test_agent.py b/nova/tests/unit/virt/xenapi/test_agent.py
index 5004b381d4..fedbcd0599 100644
--- a/nova/tests/unit/virt/xenapi/test_agent.py
+++ b/nova/tests/unit/virt/xenapi/test_agent.py
@@ -81,7 +81,7 @@ class AgentImageFlagsTestCase(AgentTestCaseBase):
self.assertTrue(agent.should_use_agent(instance))
-class SysMetaKeyTestBase():
+class SysMetaKeyTestBase(object):
key = None
def _create_agent_with_value(self, value):
diff --git a/nova/tests/unit/virt/xenapi/test_vm_utils.py b/nova/tests/unit/virt/xenapi/test_vm_utils.py
index 48f7ccb286..4cbf41fcc2 100644
--- a/nova/tests/unit/virt/xenapi/test_vm_utils.py
+++ b/nova/tests/unit/virt/xenapi/test_vm_utils.py
@@ -994,7 +994,7 @@ class VDIOtherConfigTestCase(VMUtilsTestBase):
def setUp(self):
super(VDIOtherConfigTestCase, self).setUp()
- class _FakeSession():
+ class _FakeSession(object):
def call_xenapi(self, operation, *args, **kwargs):
# VDI.add_to_other_config -> VDI_add_to_other_config
method = getattr(self, operation.replace('.', '_'), None)
diff --git a/nova/tests/unit/virt/xenapi/test_xenapi.py b/nova/tests/unit/virt/xenapi/test_xenapi.py
index a927244f53..922ec43413 100644
--- a/nova/tests/unit/virt/xenapi/test_xenapi.py
+++ b/nova/tests/unit/virt/xenapi/test_xenapi.py
@@ -1321,7 +1321,7 @@ iface eth0 inet6 static
def test_finish_revert_migration(self):
instance = self._create_instance()
- class VMOpsMock():
+ class VMOpsMock(object):
def __init__(self):
self.finish_revert_migration_called = False
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index 7aba8f39cf..5fb5566528 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -1045,7 +1045,7 @@ class FakeXenAPI(object):
# Based upon _Method from xmlrpclib.
-class _Dispatcher:
+class _Dispatcher(object):
def __init__(self, send, name):
self.__send = send
self.__name = name
diff --git a/tox.ini b/tox.ini
index a8fd01212f..74d7d469a1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -68,7 +68,7 @@ commands = python setup.py build_sphinx
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
# New from hacking 0.10: H238
-ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405,H238
+ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools/xenserver*
# To get a list of functions that are more complex than 25, set max-complexity
# to 25 and run 'tox -epep8'.