diff --git a/networkapi/api_neighbor/v4/exceptions.py b/networkapi/api_neighbor/v4/exceptions.py index c2df486e..80cc0e6d 100644 --- a/networkapi/api_neighbor/v4/exceptions.py +++ b/networkapi/api_neighbor/v4/exceptions.py @@ -135,7 +135,9 @@ class LocalIpAndPeerGroupAtDifferentEnvironmentsException(APIException): def __init__(self, neighbor): self.detail = u'Not allowed to configure BGP neighbor using this Peer Group. ' \ - u'PeerGroup id = {} is not mapped to the environment of LocalIp id = {}'.\ + u'PeerGroup id = {} is not mapped to the environment of LocalIp id = {}. ' \ + u'The LocalIp environment must be associated with this PeerGroup ' \ + u'in the environment_peer_group table.'.\ format(neighbor.peer_group, neighbor.local_ip) diff --git a/networkapi/interface/resource/InterfaceChannelResource.py b/networkapi/interface/resource/InterfaceChannelResource.py index e8710998..7a2f852b 100644 --- a/networkapi/interface/resource/InterfaceChannelResource.py +++ b/networkapi/interface/resource/InterfaceChannelResource.py @@ -22,6 +22,7 @@ from networkapi.ambiente.models import Ambiente from networkapi.api_interface import exceptions as api_interface_exceptions from networkapi.api_interface import facade as api_interface_facade +from networkapi.api_rest.exceptions import NetworkAPIException from networkapi.auth import has_perm from networkapi.exception import InvalidValueError from networkapi.infrastructure.xml_utils import dumps_networkapi @@ -366,11 +367,12 @@ def handle_delete(self, request, user, *args, **kwargs): vlan_nativa='1') api_interface_facade.delete_channel(user, e, equip_dict.get(e), channel) - except Exception: + except Exception, e: + self.log.error(u'Error undeploying channel configuration: %s' % e) if keep_db: channel.status_deploy = StatusDeploy.error[0] - channel.save(user) - raise + channel.save(user, commit=True) + return self.response_error(410, e) if not keep_db: channel.delete(user)