Arista SDN. Skip configuring repeated cps 68/8668/3
authortierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 9 Mar 2020 13:14:27 +0000 (13:14 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Tue, 17 Mar 2020 16:11:09 +0000 (17:11 +0100)
Change-Id: Ic4662828b44f872a66c3a75f33ef22820e9ed200
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
RO-SDN-arista/osm_rosdn_arista/wimconn_arista.py

index 76d14b4..0b49cb0 100644 (file)
@@ -561,6 +561,7 @@ class AristaSdnConnector(SdnConnectorBase):
             vlan_processed = False
             vlan_id = ''
             i = 0
+            processed_connection_points = []
             for cp in connection_points:
                 i += 1
                 encap_info = cp.get(self.__ENCAPSULATION_INFO_PARAM)
@@ -606,6 +607,12 @@ class AristaSdnConnector(SdnConnectorBase):
                     if not interface:
                         raise SdnConnectorError(message="Connection point switch port empty for switch_dpid {}".format(switch_id),
                                                 http_code=406)
+                # remove those connections that are equal. This happens when several sriovs are located in the same
+                # compute node interface, that is, in the same switch and interface
+                switches = [x for x in switches if x not in processed_connection_points]
+                if not switches:
+                    continue
+                processed_connection_points += switches
                 for switch in switches:
                     # it should be only one switch where the mac is attached
                     if encap_type == 'dot1q':