Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{%- if include_p4rt == "y" %}{% do features.append(("p4rt", "enabled", false, "enabled")) %}{% endif %}
{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %}
{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", false, "enabled")) %}{% endif %}
{%- if include_macsec == "y" %}{% do features.append(("macsec", "disabled", false, "enabled")) %}{% endif %}
{%- if include_macsec == "y" %}{% do features.append(("macsec", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}{% endif %}
{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", true, "enabled")) %}{% endif %}
"FEATURE": {
{# has_timer field if set, will start the feature systemd .timer unit instead of .service unit #}
Expand Down
12 changes: 11 additions & 1 deletion src/sonic-host-services/scripts/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import signal

import jinja2
from sonic_py_common import device_info
from swsscommon.swsscommon import ConfigDBConnector, DBConnector, Table
from swsscommon.swsscommon import ConfigDBConnector, DBConnector, Table, SonicDBConfig

# FILE
PAM_AUTH_CONF = "/etc/pam.d/common-auth-sonic"
Expand Down Expand Up @@ -399,6 +399,12 @@ class FeatureHandler(object):
def set_feature_state(self, feature, state):
self._feature_state_table.set(feature.name, [('state', state)])

# Update the feature state in STATE_DB in namespaces in multi-asic platform
namespaces = device_info.get_namespaces()
for namespace in namespaces:
db_conn = DBConnector(STATE_DB, 0, False, namespace);
feature_state_tbl = Table(db_conn, 'FEATURE')
feature_state_tbl.set(feature.name, [('state', state)])

class Iptables(object):
def __init__(self):
Expand Down Expand Up @@ -1086,6 +1092,10 @@ class HostConfigDaemon:

self.is_multi_npu = device_info.is_multi_npu()

# Initlaize Global config that loads all database*.json
if self.is_multi_npu:
SonicDBConfig.initializeGlobalConfig()

# Initialize AAACfg
self.hostname_cache=""
self.aaacfg = AaaCfg()
Expand Down