def handle_delete_operation(self, record, full_sync_flag, directory_to_import_from): if full_sync_flag.lower() == "true": if record.get("tool_data"): return ToolHelperService.delete_tool( record.get("tool_data").get("_id"), False) if record.get("du_data"): return DuHelperService.delete_du( record.get("du_data").get("_id"), False) elif record.get("duset_data"): return DuHelperService.delete_du_set( record.get("duset_data").get("_id"), False) elif record.get("state_data"): return StateHelperService.delete_state( record.get("state_data").get("_id"), False) elif full_sync_flag.lower() == "false": return { "result": "success", "message": "Skipping as full_sync_flag is not true" } raise Exception("Processing:Conditions to process were not found")
def deleteDeploymentUnit(id): result = DuHelperService.delete_du(id) if result.get("result") == "failed": raise Exception(result) else: return jsonify(result), 200