Skip to content

Commit

Permalink
Send correct type for BMS in PRouterLinkEntry UVE
Browse files Browse the repository at this point in the history
At present, contrail-topology sends same type for BMS and VRouter in
PRouterLinkEntry UVE. Send appropriate type for VRouter and BMS as
defined in link.sandesh

Change-Id: I2e778d065df3a23de25806257e5f2397f6f7aa6b
Partial-Bug: #1711245
  • Loading branch information
Sundaresan Rajangam committed Aug 17, 2017
1 parent 1f527f9 commit bed64e0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/analytics/contrail-topology/contrail_topology/controller.py
Expand Up @@ -13,6 +13,7 @@
import random
import hashlib
from sandesh.topology_info.ttypes import TopologyInfo, TopologyUVE
from sandesh.link.ttypes import RemoteType

class PRouter(object):
def __init__(self, name, data):
Expand Down Expand Up @@ -185,7 +186,7 @@ def bms_links(self, prouter, ifm):
remote_interface_name='em0',#no idea
local_interface_index=ifi,
remote_interface_index=1, #dont know TODO:FIX
link_type=2):
link_type=RemoteType.BMS):
pass
except:
traceback.print_exc()
Expand Down Expand Up @@ -257,7 +258,7 @@ def compute(self):
remote_interface_name=pl['lldpRemPortId'],
local_interface_index=pl['lldpRemLocalPortNum'],
remote_interface_index=rii,
link_type=1):
link_type=RemoteType.PRouter):
lldp_ints.append(ifm[pl['lldpRemLocalPortNum']])
else:
if self._add_link(
Expand All @@ -267,7 +268,7 @@ def compute(self):
remote_interface_name=pl['lldpRemPortDesc'],
local_interface_index=pl['lldpRemLocalPortNum'],
remote_interface_index=rii,
link_type=1):
link_type=RemoteType.PRouter):
lldp_ints.append(ifm[pl['lldpRemLocalPortNum']])

vrouter_neighbors = []
Expand Down Expand Up @@ -298,7 +299,7 @@ def compute(self):
'ifname'],
local_interface_index=snmpport,
remote_interface_index=1, #dont know TODO:FIX
link_type=2):
link_type=RemoteType.VRouter):
vrouter_neighbors.append(
vrouter_mac_entry['vrname'])
for arp in d['PRouterEntry']['arpTable']:
Expand All @@ -323,7 +324,7 @@ def compute(self):
remote_interface_name=vr['if'][-1]['name'],#TODO
local_interface_index=arp['localIfIndex'],
remote_interface_index=1, #dont know TODO:FIX
link_type=2):
link_type=RemoteType.VRouter):
pass

def send_uve(self):
Expand Down

0 comments on commit bed64e0

Please sign in to comment.