summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-01-16 12:15:23 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2018-01-16 14:50:11 -0600
commit7f42ad2a3f5cf2694e13c38d0089396aa3192ac8 (patch)
treeb6a3b544673be457806b5fe6c1fa063a88ec534f
parenta1f24229e0c879ea12782784737c3359676a40e1 (diff)
downloadphosphor-objmgr-7f42ad2a3f5cf2694e13c38d0089396aa3192ac8.tar.gz
phosphor-objmgr-7f42ad2a3f5cf2694e13c38d0089396aa3192ac8.zip
Ignore E731 in objmgr
Ignore the error E731 "do not assign a lambda expression, use a def" in the mapper repository as it would require 3x the number of lines of code to create separate def functions and avoid syntax errors when running on the BMC. According to the python documentation under their Programming Recommendations, E731 is intended to aid debug, as the variable assigned to the lambda would just show as <lambda> in a traceback. Fixes openbmc/openbmc#2796 Change-Id: Id9248ec1f3d1a8c736749ba138d9c0e39d92e5ce Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--obmc/mapper/server.py8
-rw-r--r--setup.cfg1
2 files changed, 5 insertions, 4 deletions
diff --git a/obmc/mapper/server.py b/obmc/mapper/server.py
index 0bbcf9f..0c1df3e 100644
--- a/obmc/mapper/server.py
+++ b/obmc/mapper/server.py
@@ -541,14 +541,14 @@ class ObjectMapper(dbus.service.Object):
# Remove interfaces from a service that
# aren't in a filter.
- svc_map = def svc: (
+ svc_map = lambda svc: (
svc[0],
list(set(ifaces).intersection(svc[1])))
# Remove services where no interfaces remain after mapping.
- svc_filter = def svc: svc[1]
+ svc_filter = lambda svc: svc[1]
- obj_map = def o: (
+ obj_map = lambda o: (
tuple(*filter(svc_filter, map(svc_map, [o]))))
return dict(filter(lambda x: x, map(obj_map, item.iteritems())))
@@ -557,7 +557,7 @@ class ObjectMapper(dbus.service.Object):
if not ifaces:
return dict(item)
- obj_map = def x: (
+ obj_map = lambda x: (
x[0],
ObjectMapper.filter_interfaces(
x[1],
diff --git a/setup.cfg b/setup.cfg
index 5fd2a3e..dedc13f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,3 @@
[pycodestyle]
max-line-length = 80
+ignore = E731
OpenPOWER on IntegriCloud