Fix pep8 job to pass with latest hacking lib
Change-Id: I7e389766f2c1e23921677ddea4cdd0aa60034c19
This commit is contained in:
parent
46afd01f5f
commit
00652f87a9
@ -627,7 +627,7 @@ class LockedDict(dict):
|
||||
obj = dict(obj)
|
||||
for k, v in obj.items():
|
||||
obj[k] = unlock(v)
|
||||
elif type(obj) == tuple:
|
||||
elif isinstance(obj, tuple):
|
||||
obj = tuple([unlock(v) for v in obj])
|
||||
return obj
|
||||
return copy.deepcopy(unlock(self), memo=memo)
|
||||
|
@ -147,7 +147,7 @@ class NumberValidator(validation.Validator):
|
||||
if self.integer_only:
|
||||
# NOTE(boris-42): Force check that passed value is not float, this
|
||||
# is important cause int(float_numb) won't raise exception
|
||||
if type(value) == float:
|
||||
if isinstance(value, float):
|
||||
return self.fail("%(name)s is %(val)s which hasn't int type"
|
||||
% {"name": self.param_name, "val": value})
|
||||
num_func = int
|
||||
|
@ -914,7 +914,7 @@ def validate_output(output_type, output):
|
||||
|
||||
proper_type = _OUTPUT_SCHEMA["key_types"][key]
|
||||
if not isinstance(output[key], proper_type):
|
||||
if type(proper_type) == tuple:
|
||||
if isinstance(proper_type, tuple):
|
||||
return ("Value of %(name)s output %(key)s has wrong type "
|
||||
"'%(actual_type)s', should be in %(types)r"
|
||||
% {"name": output_type,
|
||||
|
@ -131,7 +131,7 @@ class ServiceMeta(type):
|
||||
|
||||
def __init__(cls, name, bases, namespaces):
|
||||
super(ServiceMeta, cls).__init__(name, bases, namespaces)
|
||||
bases = [c for c in cls.__bases__ if type(c) == ServiceMeta]
|
||||
bases = [c for c in cls.__bases__ if isinstance(c, ServiceMeta)]
|
||||
if not bases:
|
||||
# nothing to check
|
||||
return
|
||||
|
@ -178,7 +178,7 @@ class SLA(plugin.Plugin, validation.ValidatablePluginMixin,
|
||||
"""
|
||||
|
||||
def validate_type(self, other):
|
||||
if type(self) != type(other):
|
||||
if type(self) is not type(other):
|
||||
raise TypeError(
|
||||
"Error merging SLAs of types %s, %s. Only SLAs of the same "
|
||||
"type could be merged." % (type(self), type(other)))
|
||||
|
@ -196,7 +196,7 @@ class CliUtilsTestCase(test.TestCase):
|
||||
@ddt.unpack
|
||||
def test_pretty_float_formatter(self, obj, args, expected=None):
|
||||
formatter = cliutils.pretty_float_formatter(*args)
|
||||
if type(expected) == type and issubclass(expected, Exception):
|
||||
if type(expected) is type and issubclass(expected, Exception):
|
||||
self.assertRaises(expected, formatter, obj)
|
||||
else:
|
||||
self.assertEqual(expected, formatter(obj))
|
||||
|
@ -170,7 +170,7 @@ class HookExecutorTestCase(test.TestCase):
|
||||
self.assertEqual(
|
||||
[{
|
||||
"config": self.conf["hooks"][0],
|
||||
"results":[
|
||||
"results": [
|
||||
{
|
||||
"triggered_by": {"event_type": "time", "value": 2},
|
||||
"started_at": fakes.FakeTimer().timestamp(),
|
||||
|
Loading…
Reference in New Issue
Block a user