Merge "Bump hacking version"
This commit is contained in:
commit
5e914c27a0
@ -24,7 +24,7 @@ repos:
|
|||||||
- id: remove-tabs
|
- id: remove-tabs
|
||||||
exclude: '.*\.(svg)$'
|
exclude: '.*\.(svg)$'
|
||||||
- repo: https://opendev.org/openstack/hacking
|
- repo: https://opendev.org/openstack/hacking
|
||||||
rev: 6.0.1
|
rev: 6.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: hacking
|
- id: hacking
|
||||||
additional_dependencies: []
|
additional_dependencies: []
|
||||||
|
@ -3390,7 +3390,7 @@ class API:
|
|||||||
"error_msg": str(exc)})
|
"error_msg": str(exc)})
|
||||||
attr = 'task_state'
|
attr = 'task_state'
|
||||||
state = task_states.DELETING
|
state = task_states.DELETING
|
||||||
if type(ex) == exception.InstanceNotFound:
|
if type(ex) is exception.InstanceNotFound:
|
||||||
attr = 'vm_state'
|
attr = 'vm_state'
|
||||||
state = vm_states.DELETED
|
state = vm_states.DELETED
|
||||||
raise exception.InstanceInvalidState(attr=attr,
|
raise exception.InstanceInvalidState(attr=attr,
|
||||||
|
@ -820,10 +820,10 @@ class MatchType(object):
|
|||||||
self.wanttype = wanttype
|
self.wanttype = wanttype
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return type(other) == self.wanttype
|
return type(other) is self.wanttype
|
||||||
|
|
||||||
def __ne__(self, other):
|
def __ne__(self, other):
|
||||||
return type(other) != self.wanttype
|
return type(other) is not self.wanttype
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<MatchType:" + str(self.wanttype) + ">"
|
return "<MatchType:" + str(self.wanttype) + ">"
|
||||||
|
4
nova/tests/fixtures/libvirt.py
vendored
4
nova/tests/fixtures/libvirt.py
vendored
@ -2157,10 +2157,10 @@ class Connection(object):
|
|||||||
|
|
||||||
def openAuth(uri, auth, flags=0):
|
def openAuth(uri, auth, flags=0):
|
||||||
|
|
||||||
if type(auth) != list:
|
if type(auth) is not list:
|
||||||
raise Exception("Expected a list for 'auth' parameter")
|
raise Exception("Expected a list for 'auth' parameter")
|
||||||
|
|
||||||
if type(auth[0]) != list:
|
if type(auth[0]) is not list:
|
||||||
raise Exception("Expected a function in 'auth[0]' parameter")
|
raise Exception("Expected a function in 'auth[0]' parameter")
|
||||||
|
|
||||||
if not callable(auth[1]):
|
if not callable(auth[1]):
|
||||||
|
@ -12918,7 +12918,7 @@ class ComputeAPIAggrTestCase(BaseTestCase):
|
|||||||
self.aggr = aggr
|
self.aggr = aggr
|
||||||
|
|
||||||
def __eq__(self, other_aggr):
|
def __eq__(self, other_aggr):
|
||||||
if type(self.aggr) != type(other_aggr):
|
if type(self.aggr) is not type(other_aggr):
|
||||||
return False
|
return False
|
||||||
return self.aggr.id == other_aggr.id
|
return self.aggr.id == other_aggr.id
|
||||||
|
|
||||||
|
@ -7728,7 +7728,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
|||||||
had_pci = 0
|
had_pci = 0
|
||||||
# care only about the PCI devices
|
# care only about the PCI devices
|
||||||
for dev in cfg.devices:
|
for dev in cfg.devices:
|
||||||
if type(dev) == vconfig.LibvirtConfigGuestHostdevPCI:
|
if type(dev) is vconfig.LibvirtConfigGuestHostdevPCI:
|
||||||
had_pci += 1
|
had_pci += 1
|
||||||
self.assertEqual(dev.type, 'pci')
|
self.assertEqual(dev.type, 'pci')
|
||||||
self.assertEqual(dev.managed, 'yes')
|
self.assertEqual(dev.managed, 'yes')
|
||||||
@ -13500,7 +13500,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
|||||||
self.assertGreater(len(job_info_records), 0)
|
self.assertGreater(len(job_info_records), 0)
|
||||||
rec = job_info_records.pop(0)
|
rec = job_info_records.pop(0)
|
||||||
|
|
||||||
if type(rec) == str:
|
if type(rec) is str:
|
||||||
if rec == "thread-finish":
|
if rec == "thread-finish":
|
||||||
finish_event.send()
|
finish_event.send()
|
||||||
elif rec == "domain-stop":
|
elif rec == "domain-stop":
|
||||||
@ -14176,7 +14176,7 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
|||||||
|
|
||||||
class AnyEventletEvent(object):
|
class AnyEventletEvent(object):
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return type(other) == eventlet.event.Event
|
return type(other) is eventlet.event.Event
|
||||||
|
|
||||||
mock_thread.assert_called_once_with(
|
mock_thread.assert_called_once_with(
|
||||||
drvr._live_migration_operation,
|
drvr._live_migration_operation,
|
||||||
|
@ -399,7 +399,7 @@ class VCPUTopologyTest(test.NoDBTestCase):
|
|||||||
|
|
||||||
for topo_test in testdata:
|
for topo_test in testdata:
|
||||||
image_meta = objects.ImageMeta.from_dict(topo_test["image"])
|
image_meta = objects.ImageMeta.from_dict(topo_test["image"])
|
||||||
if type(topo_test["expect"]) == tuple:
|
if type(topo_test["expect"]) is tuple:
|
||||||
(preferred, maximum) = hw.get_cpu_topology_constraints(
|
(preferred, maximum) = hw.get_cpu_topology_constraints(
|
||||||
topo_test["flavor"], image_meta)
|
topo_test["flavor"], image_meta)
|
||||||
|
|
||||||
@ -525,7 +525,7 @@ class VCPUTopologyTest(test.NoDBTestCase):
|
|||||||
]
|
]
|
||||||
|
|
||||||
for topo_test in testdata:
|
for topo_test in testdata:
|
||||||
if type(topo_test["expect"]) == list:
|
if type(topo_test["expect"]) is list:
|
||||||
actual = []
|
actual = []
|
||||||
for topology in hw._get_possible_cpu_topologies(
|
for topology in hw._get_possible_cpu_topologies(
|
||||||
topo_test["vcpus"],
|
topo_test["vcpus"],
|
||||||
@ -1001,7 +1001,7 @@ class NUMATopologyTest(test.NoDBTestCase):
|
|||||||
cpu_policy = hw.get_cpu_policy_constraint(
|
cpu_policy = hw.get_cpu_policy_constraint(
|
||||||
testitem["flavor"], image_meta)
|
testitem["flavor"], image_meta)
|
||||||
self.assertIsNone(cpu_policy)
|
self.assertIsNone(cpu_policy)
|
||||||
elif type(testitem["expect"]) == type:
|
elif type(testitem["expect"]) is type:
|
||||||
self.assertRaises(testitem["expect"],
|
self.assertRaises(testitem["expect"],
|
||||||
hw.get_cpu_policy_constraint,
|
hw.get_cpu_policy_constraint,
|
||||||
testitem["flavor"],
|
testitem["flavor"],
|
||||||
@ -1990,7 +1990,7 @@ class NUMATopologyTest(test.NoDBTestCase):
|
|||||||
topology = hw.numa_get_constraints(
|
topology = hw.numa_get_constraints(
|
||||||
testitem["flavor"], image_meta)
|
testitem["flavor"], image_meta)
|
||||||
self.assertIsNone(topology)
|
self.assertIsNone(topology)
|
||||||
elif type(testitem["expect"]) == type:
|
elif type(testitem["expect"]) is type:
|
||||||
self.assertRaises(testitem["expect"],
|
self.assertRaises(testitem["expect"],
|
||||||
hw.numa_get_constraints,
|
hw.numa_get_constraints,
|
||||||
testitem["flavor"],
|
testitem["flavor"],
|
||||||
|
@ -269,7 +269,7 @@ class LibvirtConfigDomainCapsDevices(LibvirtConfigObject):
|
|||||||
|
|
||||||
def _get_device(self, device_type):
|
def _get_device(self, device_type):
|
||||||
for device in self.devices:
|
for device in self.devices:
|
||||||
if type(device) == self.DEVICE_PARSERS.get(device_type):
|
if type(device) is self.DEVICE_PARSERS.get(device_type):
|
||||||
return device
|
return device
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -3114,7 +3114,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
|||||||
purge_props=False)
|
purge_props=False)
|
||||||
except (NotImplementedError, exception.ImageUnacceptable,
|
except (NotImplementedError, exception.ImageUnacceptable,
|
||||||
exception.Forbidden) as e:
|
exception.Forbidden) as e:
|
||||||
if type(e) != NotImplementedError:
|
if type(e) is not NotImplementedError:
|
||||||
LOG.warning('Performing standard snapshot because direct '
|
LOG.warning('Performing standard snapshot because direct '
|
||||||
'snapshot failed: %(error)s',
|
'snapshot failed: %(error)s',
|
||||||
{'error': encodeutils.exception_to_unicode(e)})
|
{'error': encodeutils.exception_to_unicode(e)})
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
hacking==6.1.0 # Apache-2.0
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
|
||||||
# process, which may cause wedges in the gate later.
|
|
||||||
|
|
||||||
hacking>=6.0.1,<=6.0.1 # Apache-2.0
|
|
||||||
mypy>=0.761 # MIT
|
mypy>=0.761 # MIT
|
||||||
types-paramiko>=0.1.3 # Apache-2.0
|
types-paramiko>=0.1.3 # Apache-2.0
|
||||||
coverage!=4.4,>=4.0 # Apache-2.0
|
coverage!=4.4,>=4.0 # Apache-2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user