From 72b7b6c157c643549006fea1eb4f7348581cb9a4 Mon Sep 17 00:00:00 2001 From: Yaron Yogev Date: Thu, 10 Aug 2017 15:42:41 +0300 Subject: US2853 add switch-switch links Change-Id: I5e27d33f32dc1dfe930cb692cd98604cf437855b Signed-off-by: Yaron Yogev --- app/discover/find_links_for_vedges.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'app/discover/find_links_for_vedges.py') diff --git a/app/discover/find_links_for_vedges.py b/app/discover/find_links_for_vedges.py index 1235074..f452d97 100644 --- a/app/discover/find_links_for_vedges.py +++ b/app/discover/find_links_for_vedges.py @@ -45,10 +45,12 @@ class FindLinksForVedges(FindLinks): link_weight = 0 # TBD source_label = vnic["mac_address"] target_label = port["id"] - self.create_link(self.get_env(), vedge["host"], + self.create_link(self.get_env(), source, source_id, target, target_id, link_type, link_name, state, link_weight, - source_label, target_label) + host=vedge["host"], + extra_attributes={"source_label": source_label, + "target_label": target_label}) def find_matching_vconnector(self, vedge, port): if self.configuration.has_network_plugin('VPP'): @@ -79,7 +81,8 @@ class FindLinksForVedges(FindLinks): source_label = vconnector_interface_name target_label = port["name"] mac_address = "Unknown" - attributes = {'mac_address': mac_address} + attributes = {'mac_address': mac_address, 'source_label': source_label, + 'target_label': target_label} for interface in vconnector['interfaces'].values(): if vconnector_interface_name != interface['name']: continue @@ -90,11 +93,11 @@ class FindLinksForVedges(FindLinks): break if 'network' in vconnector: attributes['network'] = vconnector['network'] - self.create_link(self.get_env(), vedge["host"], + self.create_link(self.get_env(), source, source_id, target, target_id, link_type, link_name, state, link_weight, - source_label, target_label, - attributes) + host=vedge["host"], + extra_attributes=attributes) def find_matching_pnic(self, vedge, port): pname = port["name"] @@ -119,6 +122,7 @@ class FindLinksForVedges(FindLinks): link_name = "Port-" + port["id"] state = "up" if pnic["Link detected"] == "yes" else "down" link_weight = 0 # TBD - self.create_link(self.get_env(), vedge["host"], + self.create_link(self.get_env(), source, source_id, target, target_id, - link_type, link_name, state, link_weight) + link_type, link_name, state, link_weight, + host=vedge["host"]) -- cgit 1.2.3-korg