summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/obmc/wsgi/apps/rest_dbus.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py
index e0c2edf..b47ea4e 100644
--- a/module/obmc/wsgi/apps/rest_dbus.py
+++ b/module/obmc/wsgi/apps/rest_dbus.py
@@ -343,7 +343,7 @@ class MethodHandler(RouteHandler):
def setup(self, path, method):
request.route_data['map'] = self.find(path, method)
- def do_post(self, path, method):
+ def do_post(self, path, method, retry=True):
try:
args = []
if request.parameter_list:
@@ -371,7 +371,7 @@ class MethodHandler(RouteHandler):
except dbus.exceptions.DBusException, e:
paramlist = []
- if e.get_dbus_name() == DBUS_INVALID_ARGS:
+ if e.get_dbus_name() == DBUS_INVALID_ARGS and retry == True:
signature_list = get_method_signature(self.bus, self.service,
path, self.interface,
@@ -387,7 +387,7 @@ class MethodHandler(RouteHandler):
converted_value = convert_type(expected_type, value)
paramlist.append(converted_value)
request.parameter_list = paramlist
- self.do_post(path, method)
+ self.do_post(path, method, False)
return
except Exception as ex:
abort(400, "Failed to convert the types")
@@ -454,7 +454,7 @@ class PropertyHandler(RouteHandler):
name = request.route_data['name']
return request.route_data['obj'][path][name]
- def do_put(self, path, prop, value=None):
+ def do_put(self, path, prop, value=None, retry=True):
if value is None:
value = request.parameter_list
@@ -465,7 +465,7 @@ class PropertyHandler(RouteHandler):
except ValueError, e:
abort(400, str(e))
except dbus.exceptions.DBusException, e:
- if e.get_dbus_name() == DBUS_INVALID_ARGS:
+ if e.get_dbus_name() == DBUS_INVALID_ARGS and retry == True:
bus_name = properties_iface.bus_name
expected_type = get_type_signature_by_introspection(self.bus,
bus_name,
@@ -476,7 +476,7 @@ class PropertyHandler(RouteHandler):
converted_value = None
try:
converted_value = convert_type(expected_type, value)
- self.do_put(path, prop, converted_value)
+ self.do_put(path, prop, converted_value, False)
return
except Exception as ex:
abort(403, "Failed to convert %s to type %s" %
OpenPOWER on IntegriCloud