File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ topology:
3939
4040 links:
4141 {% set processed_endpoints = [] %}
42+ {% set device_kinds = {} %}
43+ {% for device in topology .node .devices .edges %}
44+ {% set _ = device_kinds .update ({device .node .name .value : device .node .platform .node .containerlab_os .value }) %}
45+ {% endfor %}
4246 {% for device in topology .node .devices .edges %}
4347 {% for interface in device .node .interfaces .edges %}
4448 {% if interface .node .connector is defined and interface .node .connector .node is not none and interface .node .role .value not in ["console" , "management" ] %}
@@ -51,6 +55,14 @@ topology:
5155 {% set _ = processed_endpoints .append (endpoint_key ) %}
5256 {% set endpoint 1 = endpoint 1.replace ("Ethernet" , "eth" ) %}
5357 {% set endpoint 2 = endpoint 2.replace ("Ethernet" , "eth" ) %}
58+ {% set device 1_name = endpoint 1.split (":" )[0] %}
59+ {% set device 2_name = endpoint 2.split (":" )[0] %}
60+ {% if device_kinds .get (device 1_name ) == "arista_ceos" %}
61+ {% set endpoint 1 = endpoint 1.split ("/" )[0] %}
62+ {% endif %}
63+ {% if device_kinds .get (device 2_name ) == "arista_ceos" %}
64+ {% set endpoint 2 = endpoint 2.split ("/" )[0] %}
65+ {% endif %}
5466 - endpoints: ["{{ endpoint1 }}", "{{ endpoint2 }}"]
5567 {% endif %}
5668 {% endif %}
You can’t perform that action at this time.
0 commit comments