X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO-SDN-arista_cloudvision%2Fosm_rosdn_arista_cloudvision%2FaristaConfigLet.py;h=f45ec758e1b2983fd7cb8b53a4e25ba5f07a6a7d;hb=0108e942476c51824199dba8caffd3914e3e2f35;hp=8e34091eee7fcf7366ab7b3435205273dcfce465;hpb=667d158c0d3ee7b4c176ad0b27ac428c81b0ddbc;p=osm%2FRO.git diff --git a/RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision/aristaConfigLet.py b/RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision/aristaConfigLet.py index 8e34091e..f45ec758 100644 --- a/RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision/aristaConfigLet.py +++ b/RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision/aristaConfigLet.py @@ -38,7 +38,7 @@ class AristaSDNConfigLet: def __init__(self, topology=_VXLAN_MLAG): self.topology = topology - _basic_int =""" + _basic_int = """ interface {interface} !! service: {uuid} switchport @@ -54,10 +54,10 @@ interface {interface} switchport_def = self._int_SRIOV.format(service=s_type, vlan_id=vlan_id) else: switchport_def = self._int_PASSTROUGH.format(vlan_id=vlan_id) - return self._basic_int.format(uuid=uuid, - interface=interface, - type=i_type, - switchport_def=switchport_def) + + return self._basic_int.format( + uuid=uuid, interface=interface, type=i_type, switchport_def=switchport_def + ) def getElan_sriov(self, uuid, interface, vlan_id, index): return self._get_interface(uuid, interface, vlan_id, "ELAN", index, "trunk") @@ -66,23 +66,27 @@ interface {interface} return self._get_interface(uuid, interface, vlan_id, "ELINE", index, "trunk") def getElan_passthrough(self, uuid, interface, vlan_id, index): - return self._get_interface(uuid, interface, vlan_id, "ELAN", index, "dot1q-tunnel") + return self._get_interface( + uuid, interface, vlan_id, "ELAN", index, "dot1q-tunnel" + ) def getEline_passthrough(self, uuid, interface, vlan_id, index): - return self._get_interface(uuid, interface, vlan_id, "ELINE", index, "dot1q-tunnel") + return self._get_interface( + uuid, interface, vlan_id, "ELINE", index, "dot1q-tunnel" + ) - _basic_vlan =""" + _basic_vlan = """ vlan {vlan} !! service: {service} {vlan} {uuid} name {service}{vlan} trunk group {service}{vlan} """ - _basic_mlag =""" trunk group MLAGPEER + _basic_mlag = """ trunk group MLAGPEER """ - _basic_vxlan ="""interface VXLAN1 + _basic_vxlan = """interface VXLAN1 VXLAN vlan {vlan} vni {vni} """ - _basic_end ="!" + _basic_end = "!" _configLet_VLAN = _basic_vlan + _basic_end _configLet_VXLAN = _basic_vlan + _basic_vxlan + _basic_end @@ -92,12 +96,21 @@ vlan {vlan} def _get_vlan(self, uuid, vlan_id, vni_id, s_type): if self.topology == self._VLAN: return self._configLet_VLAN.format(service=s_type, vlan=vlan_id, uuid=uuid) + if self.topology == self._VLAN_MLAG: - return self._configLet_VLAN_MLAG.format(service=s_type, vlan=vlan_id, uuid=uuid) + return self._configLet_VLAN_MLAG.format( + service=s_type, vlan=vlan_id, uuid=uuid + ) + if self.topology == self._VXLAN: - return self._configLet_VXLAN.format(service=s_type, vlan=vlan_id, uuid=uuid, vni=vni_id) + return self._configLet_VXLAN.format( + service=s_type, vlan=vlan_id, uuid=uuid, vni=vni_id + ) + if self.topology == self._VXLAN_MLAG: - return self._configLet_VXLAN_MLAG.format(service=s_type, vlan=vlan_id, uuid=uuid, vni=vni_id) + return self._configLet_VXLAN_MLAG.format( + service=s_type, vlan=vlan_id, uuid=uuid, vni=vni_id + ) def getElan_vlan(self, uuid, vlan_id, vni_id): return self._get_vlan(uuid, vlan_id, vni_id, "ELAN") @@ -117,12 +130,9 @@ router bgp {bgp} def _get_bgp(self, uuid, vlan_id, vni_id, loopback0, bgp, s_type): if self.topology == self._VXLAN or self.topology == self._VXLAN_MLAG: - return self._configLet_BGP.format(uuid=uuid, - bgp=bgp, - vlan=vlan_id, - loopback=loopback0, - vni=vni_id) - + return self._configLet_BGP.format( + uuid=uuid, bgp=bgp, vlan=vlan_id, loopback=loopback0, vni=vni_id + ) def getElan_bgp(self, uuid, vlan_id, vni_id, loopback0, bgp): return self._get_bgp(uuid, vlan_id, vni_id, loopback0, bgp, "ELAN")