Skip to content

[hostcfgd] Synchronize all feature statuses once upon start#4714

Merged
jleveque merged 3 commits intosonic-net:masterfrom
jleveque:hostcfgd_update_feature_at_start
Jun 20, 2020
Merged

[hostcfgd] Synchronize all feature statuses once upon start#4714
jleveque merged 3 commits intosonic-net:masterfrom
jleveque:hostcfgd_update_feature_at_start

Conversation

@jleveque
Copy link
Contributor

@jleveque jleveque commented Jun 5, 2020

  • Ensure all features (services) are in the configured state when hostcfgd starts
  • Better functionalization of code
  • Also replace calls to deprecated has_key() method in tacacs_server_handler() and tacacs_global_handler() with in keyword.

This PR depends on sonic-net/sonic-utilities#944, otherwise config load_minigraph will fail when trying to restart disabled services.

@jleveque jleveque requested review from lguohan and prsunny June 5, 2020 07:29
@jleveque jleveque self-assigned this Jun 5, 2020
@jleveque jleveque marked this pull request as draft June 5, 2020 17:20
@jleveque jleveque marked this pull request as ready for review June 5, 2020 18:08
@jleveque jleveque changed the title [hostcfgd] Update all feature statuses once upon start [hostcfgd] Synchronize all feature statuses once upon start Jun 7, 2020
prsunny
prsunny previously approved these changes Jun 20, 2020
Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

continue
feature_name = key
feature_table = self.config_db.get_table('FEATURE')
if feature_name not in feature_table.keys():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is it possible to delete a feature from feature_table after it is enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The concept is that "features" are built into the image. They cannot be removed, only disabled.

@jleveque jleveque merged commit 4d2d95e into sonic-net:master Jun 20, 2020
@jleveque jleveque deleted the hostcfgd_update_feature_at_start branch June 20, 2020 19:09
abdosi pushed a commit that referenced this pull request Jun 28, 2020
- Ensure all features (services) are in the configured state when hostcfgd starts
- Better functionalization of code
- Also replace calls to deprecated `has_key()` method in `tacacs_server_handler()` and `tacacs_global_handler()` with `in` keyword.

This PR depends on sonic-net/sonic-utilities#944, otherwise `config load_minigraph` will fail when trying to restart disabled services.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants