diff options
author | Brad Bishop <bradleyb@us.ibm.com> | 2016-04-01 14:53:05 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@us.ibm.com> | 2016-04-15 08:59:40 -0400 |
commit | f4e7498892c883837a706e6a3cff454188db06a4 (patch) | |
tree | e94a64663873330f54d5ebe0d5a95c4853b3f08d | |
parent | 71527b4a664db6fc9b736a87e5a3543ae070ad3d (diff) | |
download | phosphor-rest-server-f4e7498892c883837a706e6a3cff454188db06a4.tar.gz phosphor-rest-server-f4e7498892c883837a706e6a3cff454188db06a4.zip |
Handle differing dbus exception implementations
sdbus and python-dbus don't report the unknown interface
exception the same way, so add a workaround.
-rw-r--r-- | obmc-rest | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -34,6 +34,7 @@ import grp import crypt DBUS_UNKNOWN_INTERFACE = 'org.freedesktop.UnknownInterface' +DBUS_UNKNOWN_INTERFACE_ERROR = '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' @@ -130,6 +131,9 @@ class RouteHandler(object): 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(): + # interface doesn't have any properties + return None if DBUS_UNKNOWN_METHOD == e.get_dbus_name(): # properties interface not implemented at all return None |