From 417e56a38d2e3e33a1e9ef66effbe4d902ed2238 Mon Sep 17 00:00:00 2001 From: marcusgc Date: Mon, 24 Jun 2024 11:12:49 -0300 Subject: [PATCH 1/2] Change error message text --- networkapi/api_neighbor/v4/exceptions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/networkapi/api_neighbor/v4/exceptions.py b/networkapi/api_neighbor/v4/exceptions.py index df02f2a0c..e06bee66f 100644 --- a/networkapi/api_neighbor/v4/exceptions.py +++ b/networkapi/api_neighbor/v4/exceptions.py @@ -132,18 +132,18 @@ class LocalIpAndPeerGroupAtDifferentEnvironmentsException(APIException): status_code = status.HTTP_400_BAD_REQUEST def __init__(self, neighbor): - self.detail = u'LocalIp id = {} and PeerGroup id = {} belongs to ' \ - u'different Environments'. \ - format(neighbor.local_ip, neighbor.peer_group) + 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 = {}' \ + format(neighbor.peer_group, neighbor.local_ip) class NeighborDuplicatedException(APIException): status_code = status.HTTP_400_BAD_REQUEST def __init__(self, neighbor): - self.detail = u'It already exists Neighbor with LocalAsn id = {}, ' \ + self.detail = u'Duplicated neighbor. A Neighbor with LocalAsn id = {}, ' \ u'LocalIp id = {}, RemoteAsn id = {} and ' \ - u'RemoteIp id = {}'.\ + u'RemoteIp id = {} already exists'.\ format(neighbor.local_asn, neighbor.local_ip, neighbor.remote_asn, neighbor.remote_ip) From 296779b715aa504b40b472bbc8af2e3b369c06ec Mon Sep 17 00:00:00 2001 From: marcusgc Date: Tue, 25 Jun 2024 14:34:17 -0300 Subject: [PATCH 2/2] fix allocation of intra-rack Leaf x Leaf vlans - change order to allocate vlans after allocating environments --- networkapi/api_rack/facade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/networkapi/api_rack/facade.py b/networkapi/api_rack/facade.py index 083e22425..c3c7799cc 100644 --- a/networkapi/api_rack/facade.py +++ b/networkapi/api_rack/facade.py @@ -970,8 +970,8 @@ def allocate_env_vlan(user, rack_id): rack_env.spine_leaf_vlans_save() # leaf x leaf - rack_env.leaf_leaf_vlans_save() rack_env.leaf_leaf_envs_save() + rack_env.leaf_leaf_vlans_save() # producao/cloud rack_env.prod_environment_save()