[hostcfgd] If feature state entry not in the cache, add a default state (#5777)
Our use case is to register new features in runtime. The previous change which introduced the cache broke this capability and caused hostcfgd crash. Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
This commit is contained in:
parent
ad555d9ffd
commit
9bc693ce6e
@ -368,6 +368,8 @@ class HostConfigDaemon:
|
|||||||
syslog.syslog(syslog.LOG_WARNING, "Enable state of feature '{}' is None".format(feature_name))
|
syslog.syslog(syslog.LOG_WARNING, "Enable state of feature '{}' is None".format(feature_name))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.cached_feature_states.setdefault(feature_name, 'disabled')
|
||||||
|
|
||||||
# Enable/disable the container service if the feature state was changed from its previous state.
|
# Enable/disable the container service if the feature state was changed from its previous state.
|
||||||
if self.cached_feature_states[feature_name] != state:
|
if self.cached_feature_states[feature_name] != state:
|
||||||
self.cached_feature_states[feature_name] = state
|
self.cached_feature_states[feature_name] = state
|
||||||
|
Loading…
Reference in New Issue
Block a user