Skip to content

Commit

Permalink
Sync has_per_asic_scope attribute to config_db in all namespaces for …
Browse files Browse the repository at this point in the history
…multi-asic
  • Loading branch information
judyjoseph committed Oct 12, 2022
1 parent 185547f commit 31c6108
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ class FeatureHandler(object):
self.set_feature_state(feature, self.FEATURE_STATE_FAILED)
return
self._config_db.mod_entry('FEATURE', feature_config.name, {'has_per_asic_scope': str(feature_config.has_per_asic_scope)})

# sync has_per_asic_scope to CONFIG_DB in namespaces in multi-asic platform
for ns, db in self.ns_cfg_db.items():
db.mod_entry('FEATURE', feature_config.name, {'has_per_asic_scope': str(feature_config.has_per_asic_scope)})

def update_systemd_config(self, feature_config):
"""Updates `Restart=` field in feature's systemd configuration file
Expand Down Expand Up @@ -474,14 +478,14 @@ class FeatureHandler(object):
def resync_feature_state(self, feature):
self._config_db.mod_entry('FEATURE', feature.name, {'state': feature.state})

# resync the feature state in CONFIG_DB in namespaces in multi-asic platform
# resync the feature state to CONFIG_DB in namespaces in multi-asic platform
for ns, db in self.ns_cfg_db.items():
db.mod_entry('FEATURE', feature.name, {'state': feature.state})

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
# Update the feature state to STATE_DB in namespaces in multi-asic platform
for ns, tbl in self.ns_feature_state_tbl.items():
tbl.set(feature.name, [('state', state)])

Expand Down

0 comments on commit 31c6108

Please sign in to comment.