bindings: Skip the default ifaces on enumerate
The C++ mapper will now return D-Bus object paths that only
contain the 3 default D-Bus interfaces:
* org.freedesktop.DBus.Introspectable
* org.freedesktop.DBus.Peer
* org.freedesktop.DBus.Properties
Whereas before it would filter out these paths.
As these paths aren't explicitly hosted by a service,
trying to do a GetAll method to read their properties,
which would occur during an enumerate REST operation,
would fail.
The fix is to skip trying to read properties on these
interfaces.
Change-Id: I9b306a4fbefa78c60f739c1351cd32ee2c36c234
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/obmc/mapper/bindings.py b/obmc/mapper/bindings.py
index 8fbcd51..8024105 100644
--- a/obmc/mapper/bindings.py
+++ b/obmc/mapper/bindings.py
@@ -24,6 +24,12 @@
MAPPER_PATH = '/xyz/openbmc_project/object_mapper'
MAPPER_NOT_FOUND = 'org.freedesktop.DBus.Error.FileNotFound'
+# The default D-Bus interfaces that we don't need to get
+# properties on during an enumerate.
+DEFAULT_IFACES = ['org.freedesktop.DBus.Introspectable',
+ 'org.freedesktop.DBus.Peer',
+ 'org.freedesktop.DBus.Properties']
+
class Mapper:
def __init__(self, bus):
@@ -108,6 +114,8 @@
for i in interfaces:
if match and not match(i):
continue
+ if i in DEFAULT_IFACES:
+ continue
properties.update(self.__get_properties_on_iface(
properties_iface, i))