Return HTTP 503 when mapper is busy
Suppress traceback and provide an informative error message
when the mapper cannot respond to a query.
Resolves openbmc/openbmc#812
Change-Id: I85d4e59c5a25dc8a19fbdb1d1cf8c2a0f4350991
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py
index b1da97d..93f0895 100644
--- a/module/obmc/wsgi/apps/rest_dbus.py
+++ b/module/obmc/wsgi/apps/rest_dbus.py
@@ -96,6 +96,9 @@
try:
return f(**kw)
except dbus.exceptions.DBusException, e:
+ if e.get_dbus_name() == \
+ 'org.freedesktop.DBus.Error.ObjectPathInUse':
+ abort(503, str(e))
if e.get_dbus_name() != obmc.mapper.MAPPER_NOT_FOUND:
raise
if callback is None: