Make backend device checking more robust (#5730)
Treat devices that are ToRRouters (ToRRouters and BackEndToRRouters) the same when rendering templates Except for BackEndToRRouters belonging to a storage cluster, since these devices have extra sub-interfaces created Treat devices that are LeafRouters (LeafRouters and BackEndLeafRouters) the same when rendering templates Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
This commit is contained in:
parent
bec01ae3bb
commit
d0f16c0d79
@ -1,7 +1,7 @@
|
|||||||
{# Get sai.profile based on switch_role #}
|
{# Get sai.profile based on switch_role #}
|
||||||
{%- if DEVICE_METADATA is defined -%}
|
{%- if DEVICE_METADATA is defined -%}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-a7060-cx32s-32x40G-t0.config.bcm' -%}
|
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-a7060-cx32s-32x40G-t0.config.bcm' -%}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-a7060-cx32s-32x40G-t1.config.bcm' -%}
|
{%- set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-a7060-cx32s-32x40G-t1.config.bcm' -%}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{# Get sai.profile based on switch_role #}
|
{# Get sai.profile based on switch_role #}
|
||||||
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined -%}
|
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined -%}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t0.config.bcm' -%}
|
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t0.config.bcm' -%}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t1.config.bcm' -%}
|
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-seastone-dx010-32x100G-t1.config.bcm' -%}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{# Get sai.profile based on switch_role #}
|
{# Get sai.profile based on switch_role #}
|
||||||
{%- if DEVICE_METADATA is defined -%}
|
{%- if DEVICE_METADATA is defined -%}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-s6100-64x40G-t0.config.bcm' -%}
|
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-s6100-64x40G-t0.config.bcm' -%}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-s6100-64x40G-t1.config.bcm' -%}
|
{%- set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th-s6100-64x40G-t1.config.bcm' -%}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{# Get sai.profile based on switch_role #}
|
{# Get sai.profile based on switch_role #}
|
||||||
{%- if DEVICE_METADATA is defined -%}
|
{%- if DEVICE_METADATA is defined -%}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-z9264f-64x40G-t0.config.bcm' -%}
|
{% set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-z9264f-64x40G-t0.config.bcm' -%}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-z9264f-64x40G-t1.config.bcm' -%}
|
{%- set sai_profile_contents = 'SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-z9264f-64x40G-t1.config.bcm' -%}
|
||||||
|
@ -9,9 +9,9 @@ def
|
|||||||
{# Determine device topology and filename postfix #}
|
{# Determine device topology and filename postfix #}
|
||||||
{%- if DEVICE_METADATA is defined %}
|
{%- if DEVICE_METADATA is defined %}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't0' %}
|
{%- set filename_postfix = 't0' %}
|
||||||
{%- elif switch_role.lower() == 'leafrouter' %}
|
{%- elif 'leafrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't1' %}
|
{%- set filename_postfix = 't1' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set filename_postfix = set_default_topology() %}
|
{%- set filename_postfix = set_default_topology() %}
|
||||||
@ -62,7 +62,7 @@ def
|
|||||||
{%- if cable_len -%}
|
{%- if cable_len -%}
|
||||||
{{ cable_len.0 }}
|
{{ cable_len.0 }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- for local_port in VLAN_MEMBER %}
|
{%- for local_port in VLAN_MEMBER %}
|
||||||
{%- if local_port[1] == port_name %}
|
{%- if local_port[1] == port_name %}
|
||||||
{%- set roles3 = switch_role + '_' + 'server' %}
|
{%- set roles3 = switch_role + '_' + 'server' %}
|
||||||
|
@ -9,9 +9,9 @@ def
|
|||||||
{# Determine device topology and filename postfix #}
|
{# Determine device topology and filename postfix #}
|
||||||
{%- if DEVICE_METADATA is defined %}
|
{%- if DEVICE_METADATA is defined %}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't0' %}
|
{%- set filename_postfix = 't0' %}
|
||||||
{%- elif switch_role.lower() == 'leafrouter' %}
|
{%- elif 'leafrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't1' %}
|
{%- set filename_postfix = 't1' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set filename_postfix = set_default_topology() %}
|
{%- set filename_postfix = set_default_topology() %}
|
||||||
@ -62,7 +62,7 @@ def
|
|||||||
{%- if cable_len -%}
|
{%- if cable_len -%}
|
||||||
{{ cable_len.0 }}
|
{{ cable_len.0 }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- for local_port in VLAN_MEMBER %}
|
{%- for local_port in VLAN_MEMBER %}
|
||||||
{%- if local_port[1] == port_name %}
|
{%- if local_port[1] == port_name %}
|
||||||
{%- set roles3 = switch_role + '_' + 'server' %}
|
{%- set roles3 = switch_role + '_' + 'server' %}
|
||||||
|
@ -9,9 +9,9 @@ def
|
|||||||
{# Determine device topology and filename postfix #}
|
{# Determine device topology and filename postfix #}
|
||||||
{%- if DEVICE_METADATA is defined %}
|
{%- if DEVICE_METADATA is defined %}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't0' %}
|
{%- set filename_postfix = 't0' %}
|
||||||
{%- elif switch_role.lower() == 'leafrouter' %}
|
{%- elif 'leafrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't1' %}
|
{%- set filename_postfix = 't1' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set filename_postfix = set_default_topology() %}
|
{%- set filename_postfix = set_default_topology() %}
|
||||||
@ -62,7 +62,7 @@ def
|
|||||||
{%- if cable_len -%}
|
{%- if cable_len -%}
|
||||||
{{ cable_len.0 }}
|
{{ cable_len.0 }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- for local_port in VLAN_MEMBER %}
|
{%- for local_port in VLAN_MEMBER %}
|
||||||
{%- if local_port[1] == port_name %}
|
{%- if local_port[1] == port_name %}
|
||||||
{%- set roles3 = switch_role + '_' + 'server' %}
|
{%- set roles3 = switch_role + '_' + 'server' %}
|
||||||
|
@ -9,9 +9,9 @@ def
|
|||||||
{# Determine device topology and filename postfix #}
|
{# Determine device topology and filename postfix #}
|
||||||
{%- if DEVICE_METADATA is defined %}
|
{%- if DEVICE_METADATA is defined %}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't0' %}
|
{%- set filename_postfix = 't0' %}
|
||||||
{%- elif switch_role.lower() == 'leafrouter' %}
|
{%- elif 'leafrouter' in switch_role.lower() %}
|
||||||
{%- set filename_postfix = 't1' %}
|
{%- set filename_postfix = 't1' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set filename_postfix = set_default_topology() %}
|
{%- set filename_postfix = set_default_topology() %}
|
||||||
@ -62,7 +62,7 @@ def
|
|||||||
{%- if cable_len -%}
|
{%- if cable_len -%}
|
||||||
{{ cable_len.0 }}
|
{{ cable_len.0 }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() %}
|
||||||
{%- for local_port in VLAN_MEMBER %}
|
{%- for local_port in VLAN_MEMBER %}
|
||||||
{%- if local_port[1] == port_name %}
|
{%- if local_port[1] == port_name %}
|
||||||
{%- set roles3 = switch_role + '_' + 'server' %}
|
{%- set roles3 = switch_role + '_' + 'server' %}
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
{% set hash_seed = 0 %}
|
{% set hash_seed = 0 %}
|
||||||
{% set hash_seed_offset = 0 %}
|
{% set hash_seed_offset = 0 %}
|
||||||
{% if DEVICE_METADATA.localhost.type %}
|
{% if DEVICE_METADATA.localhost.type %}
|
||||||
{% if DEVICE_METADATA.localhost.type == "ToRRouter" %}
|
{% if "ToRRouter" in DEVICE_METADATA.localhost.type %}
|
||||||
{% set hash_seed = 0 %}
|
{% set hash_seed = 0 %}
|
||||||
{% elif DEVICE_METADATA.localhost.type == "LeafRouter" %}
|
{% elif "LeafRouter" in DEVICE_METADATA.localhost.type %}
|
||||||
{% set hash_seed = 10 %}
|
{% set hash_seed = 10 %}
|
||||||
{% elif DEVICE_METADATA.localhost.type == "SpineRouter" %}
|
{% elif "SpineRouter" in DEVICE_METADATA.localhost.type %}
|
||||||
{% set hash_seed = 25 %}
|
{% set hash_seed = 25 %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -30,7 +30,7 @@ dependent_startup=true
|
|||||||
{# Router advertiser should only run on ToR (T0) devices which have #}
|
{# Router advertiser should only run on ToR (T0) devices which have #}
|
||||||
{# at least one VLAN interface which has an IPv6 address asigned #}
|
{# at least one VLAN interface which has an IPv6 address asigned #}
|
||||||
{%- set vlan_v6 = namespace(count=0) -%}
|
{%- set vlan_v6 = namespace(count=0) -%}
|
||||||
{%- if DEVICE_METADATA.localhost.type == "ToRRouter" -%}
|
{%- if "ToRRouter" in DEVICE_METADATA.localhost.type and DEVICE_METADATA.localhost.type != "MgmtToRRouter" -%}
|
||||||
{%- if VLAN_INTERFACE -%}
|
{%- if VLAN_INTERFACE -%}
|
||||||
{%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%}
|
{%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%}
|
||||||
{# If this VLAN has an IPv6 address... #}
|
{# If this VLAN has an IPv6 address... #}
|
||||||
|
@ -9,9 +9,9 @@ def
|
|||||||
{# Determine device topology and filename postfix #}
|
{# Determine device topology and filename postfix #}
|
||||||
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost']['type'] is defined %}
|
{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost']['type'] is defined %}
|
||||||
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
|
||||||
{%- set filename_postfix = 't0' %}
|
{%- set filename_postfix = 't0' %}
|
||||||
{%- elif switch_role.lower() == 'leafrouter' %}
|
{%- elif 'leafrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
|
||||||
{%- set filename_postfix = 't1' %}
|
{%- set filename_postfix = 't1' %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set filename_postfix = set_default_topology() %}
|
{%- set filename_postfix = set_default_topology() %}
|
||||||
@ -69,7 +69,7 @@ def
|
|||||||
{%- if cable_len -%}
|
{%- if cable_len -%}
|
||||||
{{ cable_len.0 }}
|
{{ cable_len.0 }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- if switch_role.lower() == 'torrouter' %}
|
{%- if 'torrouter' in switch_role.lower() and 'mgmt' not in switch_role.lower()%}
|
||||||
{%- for local_port in VLAN_MEMBER %}
|
{%- for local_port in VLAN_MEMBER %}
|
||||||
{%- if local_port[1] == port_name %}
|
{%- if local_port[1] == port_name %}
|
||||||
{%- set roles3 = switch_role + '_' + 'server' %}
|
{%- set roles3 = switch_role + '_' + 'server' %}
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
"7": "7"
|
"7": "7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types %}
|
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %}
|
||||||
"DOT1P_TO_TC_MAP": {
|
"DOT1P_TO_TC_MAP": {
|
||||||
"AZURE": {
|
"AZURE": {
|
||||||
"0": "0",
|
"0": "0",
|
||||||
@ -177,7 +177,7 @@
|
|||||||
"PORT_QOS_MAP": {
|
"PORT_QOS_MAP": {
|
||||||
{% for port in PORT_ACTIVE %}
|
{% for port in PORT_ACTIVE %}
|
||||||
"{{ port }}": {
|
"{{ port }}": {
|
||||||
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types %}
|
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %}
|
||||||
"dot1p_to_tc_map" : "[DOT1P_TO_TC_MAP|AZURE]",
|
"dot1p_to_tc_map" : "[DOT1P_TO_TC_MAP|AZURE]",
|
||||||
{% else %}
|
{% else %}
|
||||||
"dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]",
|
"dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]",
|
||||||
|
@ -98,6 +98,7 @@ def parse_png(png, hname):
|
|||||||
port_speeds = {}
|
port_speeds = {}
|
||||||
console_ports = {}
|
console_ports = {}
|
||||||
mux_cable_ports = {}
|
mux_cable_ports = {}
|
||||||
|
is_storage_device = False
|
||||||
for child in png:
|
for child in png:
|
||||||
if child.tag == str(QName(ns, "DeviceInterfaceLinks")):
|
if child.tag == str(QName(ns, "DeviceInterfaceLinks")):
|
||||||
for link in child.findall(str(QName(ns, "DeviceLinkBase"))):
|
for link in child.findall(str(QName(ns, "DeviceLinkBase"))):
|
||||||
@ -153,6 +154,12 @@ def parse_png(png, hname):
|
|||||||
device_data['deployment_id'] = deployment_id
|
device_data['deployment_id'] = deployment_id
|
||||||
devices[name] = device_data
|
devices[name] = device_data
|
||||||
|
|
||||||
|
if name == hname:
|
||||||
|
cluster = device.find(str(QName(ns, "ClusterName")))
|
||||||
|
|
||||||
|
if cluster != None and "str" in cluster.text.lower():
|
||||||
|
is_storage_device = True
|
||||||
|
|
||||||
if child.tag == str(QName(ns, "DeviceInterfaceLinks")):
|
if child.tag == str(QName(ns, "DeviceInterfaceLinks")):
|
||||||
for if_link in child.findall(str(QName(ns, 'DeviceLinkBase'))):
|
for if_link in child.findall(str(QName(ns, 'DeviceLinkBase'))):
|
||||||
if str(QName(ns3, "type")) in if_link.attrib:
|
if str(QName(ns3, "type")) in if_link.attrib:
|
||||||
@ -179,7 +186,7 @@ def parse_png(png, hname):
|
|||||||
|
|
||||||
mux_cable_ports[intf_name] = "true"
|
mux_cable_ports[intf_name] = "true"
|
||||||
|
|
||||||
return (neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speeds, console_ports, mux_cable_ports)
|
return (neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speeds, console_ports, mux_cable_ports, is_storage_device)
|
||||||
|
|
||||||
def parse_asic_external_link(link, asic_name, hostname):
|
def parse_asic_external_link(link, asic_name, hostname):
|
||||||
neighbors = {}
|
neighbors = {}
|
||||||
@ -915,6 +922,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
|
|||||||
hostname = None
|
hostname = None
|
||||||
linkmetas = {}
|
linkmetas = {}
|
||||||
host_lo_intfs = None
|
host_lo_intfs = None
|
||||||
|
is_storage_device = False
|
||||||
local_devices = []
|
local_devices = []
|
||||||
|
|
||||||
# hostname is the asic_name, get the asic_id from the asic_name
|
# hostname is the asic_name, get the asic_id from the asic_name
|
||||||
@ -948,7 +956,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
|
|||||||
elif child.tag == str(QName(ns, "CpgDec")):
|
elif child.tag == str(QName(ns, "CpgDec")):
|
||||||
(bgp_sessions, bgp_internal_sessions, bgp_asn, bgp_peers_with_range, bgp_monitors) = parse_cpg(child, hostname)
|
(bgp_sessions, bgp_internal_sessions, bgp_asn, bgp_peers_with_range, bgp_monitors) = parse_cpg(child, hostname)
|
||||||
elif child.tag == str(QName(ns, "PngDec")):
|
elif child.tag == str(QName(ns, "PngDec")):
|
||||||
(neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speed_png, console_ports, mux_cable_ports) = parse_png(child, hostname)
|
(neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speed_png, console_ports, mux_cable_ports, is_storage_device) = parse_png(child, hostname)
|
||||||
elif child.tag == str(QName(ns, "UngDec")):
|
elif child.tag == str(QName(ns, "UngDec")):
|
||||||
(u_neighbors, u_devices, _, _, _, _, _, _) = parse_png(child, hostname)
|
(u_neighbors, u_devices, _, _, _, _, _, _) = parse_png(child, hostname)
|
||||||
elif child.tag == str(QName(ns, "MetadataDeclaration")):
|
elif child.tag == str(QName(ns, "MetadataDeclaration")):
|
||||||
@ -992,6 +1000,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
|
|||||||
'synchronous_mode': 'enable'
|
'synchronous_mode': 'enable'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if is_storage_device:
|
||||||
|
results['DEVICE_METADATA']['localhost']['storage_device'] = "true"
|
||||||
# for this hostname, if sub_role is defined, add sub_role in
|
# for this hostname, if sub_role is defined, add sub_role in
|
||||||
# device_metadata
|
# device_metadata
|
||||||
if sub_role is not None:
|
if sub_role is not None:
|
||||||
@ -1159,7 +1170,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
|
|||||||
|
|
||||||
results['PORTCHANNEL_INTERFACE'] = pc_intfs
|
results['PORTCHANNEL_INTERFACE'] = pc_intfs
|
||||||
|
|
||||||
if current_device['type'] in backend_device_types:
|
if current_device['type'] in backend_device_types and is_storage_device:
|
||||||
del results['INTERFACE']
|
del results['INTERFACE']
|
||||||
del results['PORTCHANNEL_INTERFACE']
|
del results['PORTCHANNEL_INTERFACE']
|
||||||
|
|
||||||
|
@ -254,6 +254,7 @@
|
|||||||
</Address>
|
</Address>
|
||||||
<Hostname>switch-t0</Hostname>
|
<Hostname>switch-t0</Hostname>
|
||||||
<HwSku>Force10-S6000</HwSku>
|
<HwSku>Force10-S6000</HwSku>
|
||||||
|
<ClusterName>AAA00PrdStr00</ClusterName>
|
||||||
</Device>
|
</Device>
|
||||||
<Device i:type="ToRRouter">
|
<Device i:type="ToRRouter">
|
||||||
<Address xmlns:d5p1="Microsoft.Search.Autopilot.NetMux">
|
<Address xmlns:d5p1="Microsoft.Search.Autopilot.NetMux">
|
||||||
|
@ -268,6 +268,7 @@
|
|||||||
<Device i:type="ToRRouter">
|
<Device i:type="ToRRouter">
|
||||||
<Hostname>switch-t0</Hostname>
|
<Hostname>switch-t0</Hostname>
|
||||||
<HwSku>Force10-S6000</HwSku>
|
<HwSku>Force10-S6000</HwSku>
|
||||||
|
<ClusterName>AAA00PrdStr00</ClusterName>
|
||||||
</Device>
|
</Device>
|
||||||
<Device i:type="LeafRouter">
|
<Device i:type="LeafRouter">
|
||||||
<Hostname>ARISTA01T1</Hostname>
|
<Hostname>ARISTA01T1</Hostname>
|
||||||
|
@ -185,6 +185,11 @@ class TestCfgGenCaseInsensitive(TestCase):
|
|||||||
else:
|
else:
|
||||||
self.assertTrue("mux_cable" not in port)
|
self.assertTrue("mux_cable" not in port)
|
||||||
|
|
||||||
|
def test_minigraph_storage_device(self):
|
||||||
|
argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'storage_device\']"'
|
||||||
|
output = self.run_script(argument)
|
||||||
|
self.assertEqual(output.strip(), "true")
|
||||||
|
|
||||||
def test_minigraph_tunnel_table(self):
|
def test_minigraph_tunnel_table(self):
|
||||||
argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "TUNNEL"'
|
argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "TUNNEL"'
|
||||||
expected_tunnel = {
|
expected_tunnel = {
|
||||||
|
Loading…
Reference in New Issue
Block a user