Skip to content

Commit

Permalink
Update init_cfg.json.j2 to handle global scope for lldp feature (#18808)
Browse files Browse the repository at this point in the history
* Update init_cfg.json.j2 to handle global scope for lldp feature

* Update sonic-feature.yang
  • Loading branch information
abdosi authored May 30, 2024
1 parent 1af02ca commit f5b20f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@
"{{feature}}": {
"state": "{{state}}",
"delayed" : {{delayed | lower()}},
"has_global_scope": {% if feature + '.service' in installer_services.split(' ') %}true{% else %}false{% endif %},
{%- 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 %},
{%- else %}
"has_global_scope": {% if feature + '.service' in installer_services.split(' ') %}true{% else %}false{% endif %},
"has_per_asic_scope": {% if feature + '@.service' in installer_services.split(' ') %}"True"{% else %}"False"{% endif %},
{%- endif %}
"auto_restart": "{{autorestart}}",
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-models/yang-models/sonic-feature.yang
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module sonic-feature{
leaf has_global_scope {
description "This configuration identicates there will only one service
spawned for the device";
type stypes:boolean_type;
type feature-scope-status;
default "false";
}

Expand Down

0 comments on commit f5b20f8

Please sign in to comment.