Cleanup for Refactor-error-messages
This patch is a clean-up patch for refactor-error-messages bp which remove the exception message from base message otherwise the same exception message display twice like this https://ibb.co/XyFWMdz . Depends-On: https://review.opendev.org/#/c/708069/ Change-Id: I56ac07e20768dbbe5610741736c0c545b1dfaa0d
This commit is contained in:
parent
6802fe09d6
commit
a35967e596
|
@ -103,9 +103,9 @@ class DeleteVPNServiceLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
|||
def delete(self, request, obj_id):
|
||||
try:
|
||||
api_vpn.vpnservice_delete(request, obj_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
exceptions.handle(
|
||||
request, _('Unable to delete VPN service. %s') % e)
|
||||
request, _('Unable to delete VPN service.'))
|
||||
|
||||
|
||||
class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||
|
@ -131,9 +131,9 @@ class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
|||
def delete(self, request, obj_id):
|
||||
try:
|
||||
api_vpn.endpointgroup_delete(request, obj_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
exceptions.handle(
|
||||
request, _('Unable to delete endpoint group. %s') % e)
|
||||
request, _('Unable to delete endpoint group.'))
|
||||
|
||||
|
||||
class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||
|
@ -164,9 +164,9 @@ class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
|||
def delete(self, request, obj_id):
|
||||
try:
|
||||
api_vpn.ikepolicy_delete(request, obj_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
exceptions.handle(
|
||||
request, _('Unable to delete IKE policy. %s') % e)
|
||||
request, _('Unable to delete IKE policy.'))
|
||||
|
||||
|
||||
class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||
|
@ -197,9 +197,9 @@ class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
|||
def delete(self, request, obj_id):
|
||||
try:
|
||||
api_vpn.ipsecpolicy_delete(request, obj_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
exceptions.handle(
|
||||
request, _('Unable to delete IPsec policy. %s') % e)
|
||||
request, _('Unable to delete IPsec policy.'))
|
||||
|
||||
|
||||
class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin,
|
||||
|
@ -226,9 +226,9 @@ class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin,
|
|||
def delete(self, request, obj_id):
|
||||
try:
|
||||
api_vpn.ipsecsiteconnection_delete(request, obj_id)
|
||||
except Exception as e:
|
||||
exceptions.handle(
|
||||
request, _('Unable to delete IPsec site connection. %s') % e)
|
||||
except Exception:
|
||||
exceptions.handle(request,
|
||||
_('Unable to delete IPsec site connection.'))
|
||||
|
||||
|
||||
class UpdateVPNServiceLink(tables.LinkAction):
|
||||
|
|
|
@ -267,9 +267,9 @@ class UpdateVPNServiceView(horizon_forms.ModalFormView):
|
|||
vpnservice_id = self.kwargs['vpnservice_id']
|
||||
try:
|
||||
return api_vpn.vpnservice_get(self.request, vpnservice_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
redirect = self.success_url
|
||||
msg = _('Unable to retrieve VPN service details. %s') % e
|
||||
msg = _('Unable to retrieve VPN service details.')
|
||||
exceptions.handle(self.request, msg, redirect=redirect)
|
||||
|
||||
def get_initial(self):
|
||||
|
@ -303,9 +303,9 @@ class UpdateEndpointGroupView(horizon_forms.ModalFormView):
|
|||
endpoint_group_id = self.kwargs['endpoint_group_id']
|
||||
try:
|
||||
return api_vpn.endpointgroup_get(self.request, endpoint_group_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
redirect = self.success_url
|
||||
msg = _('Unable to retrieve endpoint group details. %s') % e
|
||||
msg = _('Unable to retrieve endpoint group details.')
|
||||
exceptions.handle(self.request, msg, redirect=redirect)
|
||||
|
||||
def get_initial(self):
|
||||
|
@ -337,9 +337,9 @@ class UpdateIKEPolicyView(horizon_forms.ModalFormView):
|
|||
ikepolicy_id = self.kwargs['ikepolicy_id']
|
||||
try:
|
||||
return api_vpn.ikepolicy_get(self.request, ikepolicy_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
redirect = self.success_url
|
||||
msg = _('Unable to retrieve IKE policy details. %s') % e
|
||||
msg = _('Unable to retrieve IKE policy details.')
|
||||
exceptions.handle(self.request, msg, redirect=redirect)
|
||||
|
||||
def get_initial(self):
|
||||
|
@ -379,9 +379,9 @@ class UpdateIPsecPolicyView(horizon_forms.ModalFormView):
|
|||
ipsecpolicy_id = self.kwargs['ipsecpolicy_id']
|
||||
try:
|
||||
return api_vpn.ipsecpolicy_get(self.request, ipsecpolicy_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
redirect = self.success_url
|
||||
msg = _('Unable to retrieve IPsec policy details. %s') % e
|
||||
msg = _('Unable to retrieve IPsec policy details.')
|
||||
exceptions.handle(self.request, msg, redirect=redirect)
|
||||
|
||||
def get_initial(self):
|
||||
|
@ -422,9 +422,9 @@ class UpdateIPsecSiteConnectionView(horizon_forms.ModalFormView):
|
|||
connection_id = self.kwargs['ipsecsiteconnection_id']
|
||||
try:
|
||||
return api_vpn.ipsecsiteconnection_get(self.request, connection_id)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
redirect = self.success_url
|
||||
msg = _('Unable to retrieve IPsec site connection details. %s') % e
|
||||
msg = _('Unable to retrieve IPsec site connection details.')
|
||||
exceptions.handle(self.request, msg, redirect=redirect)
|
||||
|
||||
def get_initial(self):
|
||||
|
|
Loading…
Reference in New Issue