Fixing Pep8 errors of type E731

Change-Id: I7215a7065003dc8ed1d1cde7ab4a473b5da51581
Story: 2002888
Task: 23097
Signed-off-by: Mathieu Robinson <mathieu.robinson@windriver.com>
Signed-off-by: Jack Ding <jack.ding@windriver.com>
This commit is contained in:
Mathieu Robinson 2018-06-26 11:40:26 -04:00 committed by Jack Ding
parent 55becc338b
commit aa9b7e70bc
4 changed files with 12 additions and 6 deletions

View File

@ -2559,10 +2559,13 @@ def ifprofile_apply_to_host(host, profile):
eth_name_available = False
if pci_addr_available:
match_express = lambda hport, port: hport.pciaddr == port.pciaddr
elif eth_name_available:
match_express = lambda hport, port: hport.name == port.name
def match_express(hport, port):
return hport.pciaddr == port.pciaddr
elif eth_name_available:
def match_express(hport, port):
return hport.name == port.name
portPairings = []
hostPortsUsed = []

View File

@ -401,7 +401,8 @@ class SysinvObject(object):
name in self.obj_extra_fields):
yield name, getattr(self, name)
items = lambda self: list(self.iteritems())
def items(self):
return list(self.iteritems())
def __getitem__(self, name):
"""For backwards-compatibility with dict-based objects.

View File

@ -350,7 +350,9 @@ def deserialize_remote_exception(conf, data):
return RemoteError(name, failure.get('message'), trace)
ex_type = type(failure)
str_override = lambda self: message
def str_override(self):
return message
new_ex_type = type(ex_type.__name__ + "_Remote", (ex_type,),
{'__str__': str_override, '__unicode__': str_override})
try:

View File

@ -82,7 +82,7 @@ commands =
# H231..H238 are python3 compatability
# H401,H403,H404,H405 are docstring and not important
[flake8]
ignore = E501,E127,E128,E231,E266,E402,E203,E731,E126,E722,H101,H102,H104,H105,H231,H232,H233,H234,H235,H236,H237,H238,H401,H403,H404,H405
ignore = E501,E127,E128,E231,E266,E402,E203,E126,E722,H101,H102,H104,H105,H231,H232,H233,H234,H235,H236,H237,H238,H401,H403,H404,H405
builtins = _
[testenv:flake8]