diff --git a/openstack_dashboard/dashboards/admin/networks/agents/tables.py b/openstack_dashboard/dashboards/admin/networks/agents/tables.py index 3c06a30e52..0c08736c63 100644 --- a/openstack_dashboard/dashboards/admin/networks/agents/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/agents/tables.py @@ -19,7 +19,6 @@ from django.template import defaultfilters as filters from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy -from horizon import exceptions from horizon import tables from horizon.utils import filters as utils_filters @@ -50,15 +49,7 @@ class DeleteDHCPAgent(tables.DeleteAction): def delete(self, request, obj_id): network_id = self.table.kwargs['network_id'] - try: - api.neutron.remove_network_from_dhcp_agent(request, obj_id, - network_id) - except Exception as e: - LOG.info('Failed to delete agent: %s', e) - msg = _('Failed to delete agent: %s') % e - redirect = reverse('horizon:admin:networks:detail', - args=[network_id]) - exceptions.handle(request, msg, redirect=redirect) + api.neutron.remove_network_from_dhcp_agent(request, obj_id, network_id) class AddDHCPAgent(tables.LinkAction): diff --git a/openstack_dashboard/dashboards/admin/volume_types/tables.py b/openstack_dashboard/dashboards/admin/volume_types/tables.py index 61b507f166..7e3c63ac25 100644 --- a/openstack_dashboard/dashboards/admin/volume_types/tables.py +++ b/openstack_dashboard/dashboards/admin/volume_types/tables.py @@ -90,11 +90,7 @@ class DeleteVolumeType(tables.DeleteAction): policy_rules = (("volume", "volume_extension:types_manage"),) def delete(self, request, obj_id): - try: - cinder.volume_type_delete(request, obj_id) - except exceptions.BadRequest as e: - redirect_url = reverse("horizon:admin:volumes:index") - exceptions.handle(request, e, redirect=redirect_url) + cinder.volume_type_delete(request, obj_id) class CreateVolumeTypeEncryption(tables.LinkAction): diff --git a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py index 2b609edb9d..1570351d3b 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py +++ b/openstack_dashboard/dashboards/project/networks/ports/extensions/allowed_address_pairs/tables.py @@ -19,14 +19,12 @@ from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy +from horizon import tables + from openstack_dashboard import api from openstack_dashboard import policy -from horizon import exceptions -from horizon import tables - - LOG = logging.getLogger(__name__) @@ -83,10 +81,10 @@ class DeleteAllowedAddressPair(tables.DeleteAction): except Exception as e: LOG.error('Failed to update port %(port_id)s: %(reason)s', {'port_id': port_id, 'reason': e}) - redirect = reverse("horizon:project:networks:ports:detail", - args=(port_id,)) - exceptions.handle(request, _('Failed to update port %s') % port_id, - redirect=redirect) + # NOTE: No exception handling is required here because + # BatchAction.handle() does it. What we need to do is + # just to re-raise the exception. + raise class AllowedAddressPairsTable(tables.DataTable): diff --git a/openstack_dashboard/dashboards/project/networks/ports/tables.py b/openstack_dashboard/dashboards/project/networks/ports/tables.py index 3cb9f5e2e1..c7f9ef2e76 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/tables.py +++ b/openstack_dashboard/dashboards/project/networks/ports/tables.py @@ -21,7 +21,6 @@ from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy -from horizon import exceptions from horizon import tables from openstack_dashboard import api @@ -125,17 +124,15 @@ class DeletePort(policy.PolicyTargetMixin, tables.DeleteAction): policy_rules = (("network", "delete_port"),) def delete(self, request, port_id): - failure_url = "horizon:project:networks:detail" try: api.neutron.port_delete(request, port_id) except Exception as e: LOG.info('Failed to delete port %(id)s: %(exc)s', {'id': port_id, 'exc': e}) - msg = _('Failed to delete port %s') % port_id - network_id = self.table.kwargs['network_id'] - redirect = reverse(failure_url, - args=[network_id]) - exceptions.handle(request, msg, redirect=redirect) + # NOTE: No exception handling is required here because + # BatchAction.handle() does it. What we need to do is + # just to re-raise the exception. + raise class PortsTable(tables.DataTable): diff --git a/openstack_dashboard/dashboards/project/routers/ports/tables.py b/openstack_dashboard/dashboards/project/routers/ports/tables.py index d94ff049e8..60df3978bc 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/tables.py +++ b/openstack_dashboard/dashboards/project/routers/ports/tables.py @@ -19,7 +19,6 @@ from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy -from horizon import exceptions from horizon import tables from openstack_dashboard import api from openstack_dashboard.dashboards.project.networks.ports \ @@ -84,11 +83,10 @@ class RemoveInterface(policy.PolicyTargetMixin, tables.DeleteAction): except Exception as e: LOG.info('Failed to delete interface %(id)s: %(exc)s', {'id': obj_id, 'exc': e}) - msg = _('Failed to delete interface %s') % obj_id - router_id = self.table.kwargs['router_id'] - redirect = reverse(self.failure_url, - args=[router_id]) - exceptions.handle(request, msg, redirect=redirect) + # NOTE: No exception handling is required here because + # BatchAction.handle() does it. What we need to do is + # just to re-raise the exception. + raise DISPLAY_CHOICES = (