From b0f7c9cbf81c8da54e0f5d4b86b2c40b4cff8b67 Mon Sep 17 00:00:00 2001 From: Jianquan Ye Date: Fri, 26 Jul 2024 10:07:07 +1000 Subject: [PATCH] Make pmon feature delayed flag as jinja template (#19657) * Fix the Loopback0 IPv6 address of LC's in chassis not reachable from peer device's Signed-off-by: Abhishek Dosi * Added change to have flag Signed-off-by: Abhishek Dosi * Assign the metric vaule for Ipv6 default route learnt via RA message to higher value so that BGP learnt default route is higher priority. Signed-off-by: Abhishek Dosi * Add alternate name for bridge interface on supversior in chassis systrem Signed-off-by: Abhishek Dosi * Update service_checker.py * Update init_cfg.json.j2 to handle global scope for lldp feature * Update sonic-feature.yang * Added support to parse "AssociatedSliceStr" attribute of minigraph and save as `slice_type` as part of DEVICE_METADATA Signed-off-by: Abhishek Dosi * Revert "Added support to parse "AssociatedSliceStr" attribute of minigraph and" This reverts commit 0f2d26d0efd538fbc9d2ee16cb9600642753a6a7. * Added support to parse "AssociatedSliceStr" attribute of minigraph and save as `slice_type` as part of DEVICE_METADATA for Chassis Device type Signed-off-by: Abhishek Dosi * Update minigraph.py * pmon need not be delayed for SpineRouter/T2. pmon need to enable asap to detect ASIC's on Supervisor. pmonm need to enable asap for bring-up of 400G ports on LC's fast becuase of CMIS state machine present in PMON. Signed-off-by: Abhishek Dosi * Updated Yang model for Feature delay from boolean to string Signed-off-by: Abhishek Dosi * Fix Build Error Signed-off-by: Abhishek Dosi * Fix build error Signed-off-by: Abhishek Dosi * Update true/false to True/False --------- Signed-off-by: Abhishek Dosi Co-authored-by: Abhishek Dosi Co-authored-by: abdosi <58047199+abdosi@users.noreply.github.com> --- files/build_templates/init_cfg.json.j2 | 4 ++-- src/sonic-yang-models/yang-models/sonic-feature.yang | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 31be59e35017..9f909ae32871 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -37,7 +37,7 @@ {%- set features = [("bgp", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}disabled{% else %}enabled{% endif %}", false, "enabled"), ("database", "always_enabled", false, "always_enabled"), ("lldp", "enabled", true, "enabled"), - ("pmon", "enabled", true, "enabled"), + ("pmon", "enabled", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}False{% else %}True{% endif %}", "enabled"), ("snmp", "enabled", true, "enabled"), ("swss", "enabled", false, "enabled"), ("syncd", "enabled", false, "enabled")] %} @@ -70,7 +70,7 @@ {%- for feature, state, delayed, autorestart in features %} "{{feature}}": { "state": "{{state}}", - "delayed" : {{delayed | lower()}}, + "delayed" : "{{delayed}}", {%- if feature in ["lldp"] %} "has_global_scope": {% raw %}"{% if ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['linecard']) %}False{% else %}True{% endif %}"{% endraw %}, "has_per_asic_scope": {% raw %}"{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}"{% endraw %}, diff --git a/src/sonic-yang-models/yang-models/sonic-feature.yang b/src/sonic-yang-models/yang-models/sonic-feature.yang index 3ca32ad6a955..6939f0044920 100644 --- a/src/sonic-yang-models/yang-models/sonic-feature.yang +++ b/src/sonic-yang-models/yang-models/sonic-feature.yang @@ -29,6 +29,11 @@ module sonic-feature{ type string; } + typedef feature-delay-status { + description "configuration to set the feature has delay scope as True/False"; + type string; + } + container sonic-feature { container FEATURE { @@ -60,7 +65,7 @@ module sonic-feature{ leaf delayed { description "This configuration identicates if the feature needs to be delayed until system initialization"; - type stypes:boolean_type; + type feature-delay-status; default "false"; }