From 44573ab21aa463504344d311396e5c365b8ea41a Mon Sep 17 00:00:00 2001 From: Adriana Kobylak Date: Mon, 14 Jan 2019 12:54:43 -0600 Subject: rest_dbus: get_host_interface: Iterate through busnames The mapper may return multiple busnames, as it's the case for an object that has associations. So if the path is not found on the busname, continue to see if there are more busnames to try instead of quitting on the first try. Fixes: openbmc/openbmc#3460 Tested: Verified the software interfaces are working again, and that a dummy busname still raises an exception for the case where none of the busnames returned by the mapper hold the requested path. Change-Id: Iaf36dd94f728d147f20c23666e5c19062b33f97a Signed-off-by: Adriana Kobylak --- module/obmc/wsgi/apps/rest_dbus.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py index 0893d0b..a26532a 100644 --- a/module/obmc/wsgi/apps/rest_dbus.py +++ b/module/obmc/wsgi/apps/rest_dbus.py @@ -530,8 +530,11 @@ class PropertyHandler(RouteHandler): properties_iface = dbus.Interface( obj, dbus_interface=dbus.PROPERTIES_IFACE) - info = self.get_host_interface_on_bus( - path, prop, properties_iface, bus, interfaces) + try: + info = self.get_host_interface_on_bus( + path, prop, properties_iface, bus, interfaces) + except Exception: + continue if info is not None: prop, iface = info return prop, iface, properties_iface -- cgit v1.2.1