rest_dbus.py: Fix UnknownInterface error
The string "org.freedesktop.UnknownInterface" is not an
existing dbus error string, all errors are of format
*.DBus.Error.* so remove it.
Also check the dbus name instead of message for this error.
The dbus message is the description of the error, like
"Unknown interface 'foo'". The dbus name is the actual
error string, like "org.freedesktop.DBus.Error.UnknownInterface",
Change-Id: Ib54adef852713bc30f3eefc6598e28fcf5be3d29
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py
index b47ea4e..0ea921e 100644
--- a/module/obmc/wsgi/apps/rest_dbus.py
+++ b/module/obmc/wsgi/apps/rest_dbus.py
@@ -40,8 +40,7 @@
import gobject
import gevent
-DBUS_UNKNOWN_INTERFACE = 'org.freedesktop.UnknownInterface'
-DBUS_UNKNOWN_INTERFACE_ERROR = 'org.freedesktop.DBus.Error.UnknownInterface'
+DBUS_UNKNOWN_INTERFACE = 'org.freedesktop.DBus.Error.UnknownInterface'
DBUS_UNKNOWN_METHOD = 'org.freedesktop.DBus.Error.UnknownMethod'
DBUS_INVALID_ARGS = 'org.freedesktop.DBus.Error.InvalidArgs'
DBUS_TYPE_ERROR = 'org.freedesktop.DBus.Python.TypeError'
@@ -244,10 +243,7 @@
try:
return f(*a)
except dbus.exceptions.DBusException, e:
- if DBUS_UNKNOWN_INTERFACE in e.get_dbus_message():
- # interface doesn't have any properties
- return None
- if DBUS_UNKNOWN_INTERFACE_ERROR in e.get_dbus_name():
+ if DBUS_UNKNOWN_INTERFACE in e.get_dbus_name():
# interface doesn't have any properties
return None
if DBUS_UNKNOWN_METHOD == e.get_dbus_name():