summaryrefslogtreecommitdiffstats
path: root/module/obmc
diff options
context:
space:
mode:
Diffstat (limited to 'module/obmc')
-rw-r--r--module/obmc/wsgi/apps/rest_dbus.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py
index 2d98817..ffbab94 100644
--- a/module/obmc/wsgi/apps/rest_dbus.py
+++ b/module/obmc/wsgi/apps/rest_dbus.py
@@ -600,15 +600,18 @@ class InstanceHandler(RouteHandler):
path, p, v)
def do_delete(self, path):
- for bus_info in request.route_data['map'][path].items():
- if self.bus_missing_delete(path, *bus_info):
- abort(403, _4034_msg % ('resource', 'removed', path))
-
- for bus in request.route_data['map'][path].keys():
- self.delete_on_bus(path, bus)
-
- def bus_missing_delete(self, path, bus, interfaces):
- return DELETE_IFACE not in interfaces
+ deleted = False
+ for bus, interfaces in request.route_data['map'][path].items():
+ if self.bus_has_delete(interfaces):
+ self.delete_on_bus(path, bus)
+ deleted = True
+
+ #It's OK if some objects didn't have a Delete, but not all
+ if not deleted:
+ abort(403, _4034_msg % ('resource', 'removed', path))
+
+ def bus_has_delete(self, interfaces):
+ return DELETE_IFACE in interfaces
def delete_on_bus(self, path, bus):
obj = self.bus.get_object(bus, path, introspect=False)
OpenPOWER on IntegriCloud