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):
|
def delete(self, request, obj_id):
|
||||||
try:
|
try:
|
||||||
api_vpn.vpnservice_delete(request, obj_id)
|
api_vpn.vpnservice_delete(request, obj_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
exceptions.handle(
|
exceptions.handle(
|
||||||
request, _('Unable to delete VPN service. %s') % e)
|
request, _('Unable to delete VPN service.'))
|
||||||
|
|
||||||
|
|
||||||
class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||||
|
@ -131,9 +131,9 @@ class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||||
def delete(self, request, obj_id):
|
def delete(self, request, obj_id):
|
||||||
try:
|
try:
|
||||||
api_vpn.endpointgroup_delete(request, obj_id)
|
api_vpn.endpointgroup_delete(request, obj_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
exceptions.handle(
|
exceptions.handle(
|
||||||
request, _('Unable to delete endpoint group. %s') % e)
|
request, _('Unable to delete endpoint group.'))
|
||||||
|
|
||||||
|
|
||||||
class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||||
|
@ -164,9 +164,9 @@ class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||||
def delete(self, request, obj_id):
|
def delete(self, request, obj_id):
|
||||||
try:
|
try:
|
||||||
api_vpn.ikepolicy_delete(request, obj_id)
|
api_vpn.ikepolicy_delete(request, obj_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
exceptions.handle(
|
exceptions.handle(
|
||||||
request, _('Unable to delete IKE policy. %s') % e)
|
request, _('Unable to delete IKE policy.'))
|
||||||
|
|
||||||
|
|
||||||
class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||||
|
@ -197,9 +197,9 @@ class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||||
def delete(self, request, obj_id):
|
def delete(self, request, obj_id):
|
||||||
try:
|
try:
|
||||||
api_vpn.ipsecpolicy_delete(request, obj_id)
|
api_vpn.ipsecpolicy_delete(request, obj_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
exceptions.handle(
|
exceptions.handle(
|
||||||
request, _('Unable to delete IPsec policy. %s') % e)
|
request, _('Unable to delete IPsec policy.'))
|
||||||
|
|
||||||
|
|
||||||
class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin,
|
class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin,
|
||||||
|
@ -226,9 +226,9 @@ class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin,
|
||||||
def delete(self, request, obj_id):
|
def delete(self, request, obj_id):
|
||||||
try:
|
try:
|
||||||
api_vpn.ipsecsiteconnection_delete(request, obj_id)
|
api_vpn.ipsecsiteconnection_delete(request, obj_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
exceptions.handle(
|
exceptions.handle(request,
|
||||||
request, _('Unable to delete IPsec site connection. %s') % e)
|
_('Unable to delete IPsec site connection.'))
|
||||||
|
|
||||||
|
|
||||||
class UpdateVPNServiceLink(tables.LinkAction):
|
class UpdateVPNServiceLink(tables.LinkAction):
|
||||||
|
|
|
@ -267,9 +267,9 @@ class UpdateVPNServiceView(horizon_forms.ModalFormView):
|
||||||
vpnservice_id = self.kwargs['vpnservice_id']
|
vpnservice_id = self.kwargs['vpnservice_id']
|
||||||
try:
|
try:
|
||||||
return api_vpn.vpnservice_get(self.request, vpnservice_id)
|
return api_vpn.vpnservice_get(self.request, vpnservice_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
redirect = self.success_url
|
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)
|
exceptions.handle(self.request, msg, redirect=redirect)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
|
@ -303,9 +303,9 @@ class UpdateEndpointGroupView(horizon_forms.ModalFormView):
|
||||||
endpoint_group_id = self.kwargs['endpoint_group_id']
|
endpoint_group_id = self.kwargs['endpoint_group_id']
|
||||||
try:
|
try:
|
||||||
return api_vpn.endpointgroup_get(self.request, endpoint_group_id)
|
return api_vpn.endpointgroup_get(self.request, endpoint_group_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
redirect = self.success_url
|
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)
|
exceptions.handle(self.request, msg, redirect=redirect)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
|
@ -337,9 +337,9 @@ class UpdateIKEPolicyView(horizon_forms.ModalFormView):
|
||||||
ikepolicy_id = self.kwargs['ikepolicy_id']
|
ikepolicy_id = self.kwargs['ikepolicy_id']
|
||||||
try:
|
try:
|
||||||
return api_vpn.ikepolicy_get(self.request, ikepolicy_id)
|
return api_vpn.ikepolicy_get(self.request, ikepolicy_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
redirect = self.success_url
|
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)
|
exceptions.handle(self.request, msg, redirect=redirect)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
|
@ -379,9 +379,9 @@ class UpdateIPsecPolicyView(horizon_forms.ModalFormView):
|
||||||
ipsecpolicy_id = self.kwargs['ipsecpolicy_id']
|
ipsecpolicy_id = self.kwargs['ipsecpolicy_id']
|
||||||
try:
|
try:
|
||||||
return api_vpn.ipsecpolicy_get(self.request, ipsecpolicy_id)
|
return api_vpn.ipsecpolicy_get(self.request, ipsecpolicy_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
redirect = self.success_url
|
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)
|
exceptions.handle(self.request, msg, redirect=redirect)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
|
@ -422,9 +422,9 @@ class UpdateIPsecSiteConnectionView(horizon_forms.ModalFormView):
|
||||||
connection_id = self.kwargs['ipsecsiteconnection_id']
|
connection_id = self.kwargs['ipsecsiteconnection_id']
|
||||||
try:
|
try:
|
||||||
return api_vpn.ipsecsiteconnection_get(self.request, connection_id)
|
return api_vpn.ipsecsiteconnection_get(self.request, connection_id)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
redirect = self.success_url
|
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)
|
exceptions.handle(self.request, msg, redirect=redirect)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
|
|
Loading…
Reference in New Issue