From 3a00b1fd769320ee4a0e95e26c0f688e30a920bc Mon Sep 17 00:00:00 2001 From: Saqib Khan Date: Sat, 4 Nov 2017 15:56:21 -0500 Subject: Call all instances of an objectPath when executing "POST" - For example "DeleteAll" exists in both bmc updater and host updater. Therefore when a user executes DeleteAll using REST, both the two instances should be called upon. Resolves openbmc/openbmc#2490 Change-Id: Ic38b00de137593bc344ff9d743d3144a48bd5f13 Signed-off-by: Saqib Khan --- module/obmc/wsgi/apps/rest_dbus.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'module/obmc/wsgi/apps') diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py index 3f84ddd..c44a45d 100644 --- a/module/obmc/wsgi/apps/rest_dbus.py +++ b/module/obmc/wsgi/apps/rest_dbus.py @@ -328,24 +328,28 @@ class MethodHandler(RouteHandler): self.interface = '' def find(self, path, method): + method_list = [] busses = self.try_mapper_call( self.mapper.get_object, path=path) for items in busses.iteritems(): m = self.find_method_on_bus(path, method, *items) if m: - return m + method_list.append(m) + return method_list abort(404, _4034_msg % ('method', 'found', method)) def setup(self, path, method): - request.route_data['method'] = self.find(path, method) + request.route_data['map'] = self.find(path, method) def do_post(self, path, method): try: - if request.parameter_list: - return request.route_data['method'](*request.parameter_list) - else: - return request.route_data['method']() + for item in request.route_data['map']: + if request.parameter_list: + item(*request.parameter_list) + else: + item() + return except dbus.exceptions.DBusException, e: paramlist = [] -- cgit v1.2.1